基础数据-药品目录
This commit is contained in:
@@ -0,0 +1,202 @@
|
|||||||
|
package com.openhis.web.datadictionary.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
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.SecurityUtils;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.medication.domain.Medication;
|
||||||
|
import com.openhis.medication.domain.MedicationDefinition;
|
||||||
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
|
import com.openhis.medication.service.IMedicationDefinitionService;
|
||||||
|
import com.openhis.medication.service.IMedicationService;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
||||||
|
import com.openhis.web.datadictionary.mapper.MedicationManageSearchMapper;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO:药品目录
|
||||||
|
*
|
||||||
|
* @author lpt
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/datadictionary/medication")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MedicationManageController {
|
||||||
|
|
||||||
|
private final IMedicationDefinitionService iMedicationDefinitionService;
|
||||||
|
private final IMedicationService iMedicationService;
|
||||||
|
private final MedicationManageSearchMapper medicationManageSearchMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询病种目录分页列表
|
||||||
|
*
|
||||||
|
* @param searchKey 查询条件
|
||||||
|
* @param statusEnum 查询条件-状态
|
||||||
|
* @param ybMatchFlag 查询条件-是否对码
|
||||||
|
* @param categoryCode 查询条件-药品分类
|
||||||
|
* @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,
|
||||||
|
@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);
|
||||||
|
// 返回【药品录列表DTO】分页
|
||||||
|
return R.ok(medicationManageDtoPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询药品详情
|
||||||
|
*
|
||||||
|
* @param id 药品ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/information-one/{id}")
|
||||||
|
public R<?> getDiseaseOne(@PathVariable("id") Long id) {
|
||||||
|
// 获取租户ID
|
||||||
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
// 查询药品目录列表
|
||||||
|
MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId);
|
||||||
|
// 返回【药品录列表DTO】列表
|
||||||
|
return R.ok(medicationManageDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 药品目录编辑
|
||||||
|
@PutMapping("/information")
|
||||||
|
public R<?> editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
|
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||||
|
Medication medication = new Medication();
|
||||||
|
BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息
|
||||||
|
BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息
|
||||||
|
|
||||||
|
// 更新子表药品信息
|
||||||
|
if (iMedicationService.updateById(medication)) {
|
||||||
|
// 更新主表药品信息
|
||||||
|
return iMedicationDefinitionService.updateById(medicationDefinition)
|
||||||
|
? 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录停用
|
||||||
|
*
|
||||||
|
* @param ids 药品ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/information-stop")
|
||||||
|
public R<?> editMedicationStop(@RequestBody List<Long> ids) {
|
||||||
|
List<Medication> medicationList = new ArrayList<>();
|
||||||
|
// 取得更新值
|
||||||
|
for (Long detail : ids) {
|
||||||
|
Medication medication = new Medication();
|
||||||
|
medication.setId(detail);
|
||||||
|
medication.setStatusEnum(PublicationStatus.RETIRED);
|
||||||
|
medicationList.add(medication);
|
||||||
|
}
|
||||||
|
// 更新药品信息
|
||||||
|
return iMedicationService.updateBatchById(medicationList)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录停用
|
||||||
|
*
|
||||||
|
* @param ids 药品ID列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/information-start")
|
||||||
|
public R<?> editMedicationStart(@RequestBody List<Long> ids) {
|
||||||
|
List<Medication> medicationList = new ArrayList<>();
|
||||||
|
// 取得更新值
|
||||||
|
for (Long detail : ids) {
|
||||||
|
Medication medication = new Medication();
|
||||||
|
medication.setId(detail);
|
||||||
|
medication.setStatusEnum(PublicationStatus.ACTIVE);
|
||||||
|
medicationList.add(medication);
|
||||||
|
}
|
||||||
|
// 更新药品信息
|
||||||
|
return iMedicationService.updateBatchById(medicationList)
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增外来药品目录
|
||||||
|
*
|
||||||
|
* @param medicationManageUpDto 药品目录信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/information")
|
||||||
|
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
|
MedicationDetail medicationDetail = new MedicationDetail();
|
||||||
|
BeanUtils.copyProperties(medicationManageUpDto, medicationDetail);
|
||||||
|
// 新增主表外来药品目录
|
||||||
|
if (iMedicationDefinitionService.addMedication(medicationDetail)) {
|
||||||
|
// 新增子表外来药品目录
|
||||||
|
return iMedicationService.addMedication(medicationDetail)
|
||||||
|
? 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增医保药品目录
|
||||||
|
*
|
||||||
|
* @param medicationManageUpDto 药品目录信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/information-yb")
|
||||||
|
public R<?> addYbMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录导出
|
||||||
|
*
|
||||||
|
* @param medicationManageDto 药品目录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/information-export")
|
||||||
|
public R<?> exportDisease(@RequestBody MedicationManageDto medicationManageDto) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
package com.openhis.web.datadictionary.dto;
|
package com.openhis.web.datadictionary.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 lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品目录Dto
|
* 药品目录Dto
|
||||||
*
|
*
|
||||||
@@ -22,7 +21,6 @@ import java.util.Date;
|
|||||||
public class MedicationManageDto {
|
public class MedicationManageDto {
|
||||||
|
|
||||||
/** ID */
|
/** ID */
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@@ -31,7 +29,7 @@ public class MedicationManageDto {
|
|||||||
private Long medicationDefId;
|
private Long medicationDefId;
|
||||||
|
|
||||||
/** 药品状态 */
|
/** 药品状态 */
|
||||||
private Integer statusEnum;
|
private PublicationStatus statusEnum;
|
||||||
|
|
||||||
/** 所属科室 */
|
/** 所属科室 */
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
@@ -76,11 +74,9 @@ public class MedicationManageDto {
|
|||||||
private String definition;
|
private String definition;
|
||||||
|
|
||||||
/** 药品编号 */
|
/** 药品编号 */
|
||||||
@NotBlank(message = "药品编号不能为空")
|
|
||||||
private String busNo;
|
private String busNo;
|
||||||
|
|
||||||
/** 药品名称 */
|
/** 药品名称 */
|
||||||
@NotBlank(message = "药品名称不能为空")
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 适用范围 */
|
/** 适用范围 */
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package com.openhis.web.datadictionary.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录Dto
|
||||||
|
*
|
||||||
|
* @author lpt
|
||||||
|
* @date 2025-02-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MedicationManageUpDto {
|
||||||
|
|
||||||
|
/** ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 药品编码 */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long medicationDefId;
|
||||||
|
|
||||||
|
/** 所属科室 */
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/** 剂型 */
|
||||||
|
private String doseFormCode;
|
||||||
|
|
||||||
|
/** 规格 */
|
||||||
|
private String totalVolume;
|
||||||
|
|
||||||
|
/** 成分 */
|
||||||
|
private String ingredientItem;
|
||||||
|
|
||||||
|
/** 是否为活性 */
|
||||||
|
private Integer activeFlag;
|
||||||
|
|
||||||
|
/** 批次号 */
|
||||||
|
private String lotNumber;
|
||||||
|
|
||||||
|
/** 生效日期 */
|
||||||
|
private Date effectiveDate;
|
||||||
|
|
||||||
|
/** 到期日期 */
|
||||||
|
private Date expirationDate;
|
||||||
|
|
||||||
|
/** 用法 */
|
||||||
|
private String methodCode;
|
||||||
|
|
||||||
|
/** 用药频次 */
|
||||||
|
private String rateCode;
|
||||||
|
|
||||||
|
/** 单次剂量 */
|
||||||
|
private BigDecimal dose;
|
||||||
|
|
||||||
|
/** 剂量单位 */
|
||||||
|
private String doseUnitCode;
|
||||||
|
|
||||||
|
/** 单次最大剂量 */
|
||||||
|
private BigDecimal maxUnit;
|
||||||
|
|
||||||
|
/** 药品定义 */
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
/** 药品编号 */
|
||||||
|
@NotBlank(message = "药品编号不能为空")
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/** 药品名称 */
|
||||||
|
@NotBlank(message = "药品名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 适用范围 */
|
||||||
|
private Integer domainEnum;
|
||||||
|
|
||||||
|
/** 药品版本 */
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/** 英文药名 */
|
||||||
|
private String nameEn;
|
||||||
|
|
||||||
|
/** 药品名称拼音码 */
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/** 药品五笔码 */
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/** 药品分类 */
|
||||||
|
private Integer categoryCode;
|
||||||
|
|
||||||
|
/** 商品名称 */
|
||||||
|
private String merchandiseName;
|
||||||
|
|
||||||
|
/** 商品名称拼音码 */
|
||||||
|
private String merchandisePyStr;
|
||||||
|
|
||||||
|
/** 商品五笔码 */
|
||||||
|
private String merchandiseWbStr;
|
||||||
|
|
||||||
|
/** 药品单位 */
|
||||||
|
private String unitCode;
|
||||||
|
|
||||||
|
/** 最小单位 */
|
||||||
|
private String minUnitCode;
|
||||||
|
|
||||||
|
/** 所含耗材 */
|
||||||
|
private String comprisedText;
|
||||||
|
|
||||||
|
/** 成分 */
|
||||||
|
private String ingredient;
|
||||||
|
|
||||||
|
/** 拆零比 */
|
||||||
|
private BigDecimal partPercent;
|
||||||
|
|
||||||
|
/** 剂量形式 */
|
||||||
|
private Integer doseFrom;
|
||||||
|
|
||||||
|
/** 批准文号 */
|
||||||
|
private String approvalNumber;
|
||||||
|
|
||||||
|
/** 医保是否对码 */
|
||||||
|
private Integer ybMatchFlag;
|
||||||
|
|
||||||
|
/** 医保编码 */
|
||||||
|
private String ybNo;
|
||||||
|
|
||||||
|
/** 药理作用分类 */
|
||||||
|
private String pharmacologyCategoryCode;
|
||||||
|
|
||||||
|
/** 是否皮试 */
|
||||||
|
private Integer skinTestFlag;
|
||||||
|
|
||||||
|
/** 是否为注射药物 */
|
||||||
|
private Integer injectFlag;
|
||||||
|
|
||||||
|
/** 生产厂家 */
|
||||||
|
private Long manufacturerId;
|
||||||
|
|
||||||
|
/** 供应商 */
|
||||||
|
private Long supplyId;
|
||||||
|
|
||||||
|
/** 是否限制使用 */
|
||||||
|
private Integer restrictedFlag;
|
||||||
|
|
||||||
|
/** 限制使用范围 */
|
||||||
|
private String restrictedScope;
|
||||||
|
|
||||||
|
/** 儿童用药标志 */
|
||||||
|
private Integer childrenFlag;
|
||||||
|
|
||||||
|
/** 产品特性 */
|
||||||
|
private Integer characteristic;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.openhis.web.datadictionary.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||||
|
import com.openhis.web.datadictionary.dto.MedicationManageDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品目录管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author lpt
|
||||||
|
* @date 2025-02-25
|
||||||
|
*/
|
||||||
|
@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 租户
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long getPageCount(@Param("searchKey") String searchKey, @Param("ybMatchFlag") Integer ybMatchFlag,
|
||||||
|
@Param("statusEnum") Integer statusEnum, @Param("categoryCode") String categoryCode,
|
||||||
|
@Param("tenantId") Integer tenantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品详情
|
||||||
|
*
|
||||||
|
* @param id 药品ID
|
||||||
|
* @param tenantId 租户
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
MedicationManageDto getOne(@Param("id") Long id, @Param("tenantId") Integer tenantId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
<?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 T2.id,
|
||||||
|
T2.medication_def_id,
|
||||||
|
T2.status_enum,
|
||||||
|
T2.org_id,
|
||||||
|
T2.dose_form_code,
|
||||||
|
T2.total_volume,
|
||||||
|
T2.ingredient_item,
|
||||||
|
T2.active_flag,
|
||||||
|
T2.lot_number,
|
||||||
|
T2.effective_date,
|
||||||
|
T2.expiration_date,
|
||||||
|
T2.method_code,
|
||||||
|
T2.rate_code,
|
||||||
|
T2.dose,
|
||||||
|
T2.dose_unit_code,
|
||||||
|
T2.max_unit,
|
||||||
|
T2.definition,
|
||||||
|
T1.bus_no,
|
||||||
|
T1.name,
|
||||||
|
T1.domain_enum,
|
||||||
|
T1.version,
|
||||||
|
T1.name_en,
|
||||||
|
T1.py_str,
|
||||||
|
T1.wb_str,
|
||||||
|
T1.category_code,
|
||||||
|
T1.merchandise_name,
|
||||||
|
T1.merchandise_py_str,
|
||||||
|
T1.merchandise_wb_str,
|
||||||
|
T1.unit_code,
|
||||||
|
T1.min_unit_code,
|
||||||
|
T1.comprised_text,
|
||||||
|
T1.ingredient,
|
||||||
|
T1.part_percent,
|
||||||
|
T1.dose_from,
|
||||||
|
T1.approval_number,
|
||||||
|
T1.yb_match_flag,
|
||||||
|
T1.yb_no,
|
||||||
|
T1.pharmacology_category_code,
|
||||||
|
T1.skin_test_flag,
|
||||||
|
T1.inject_flag,
|
||||||
|
T1.manufacturer_id,
|
||||||
|
T1.supply_id,
|
||||||
|
T1.restricted_flag,
|
||||||
|
T1.restricted_scope,
|
||||||
|
T1.children_flag,
|
||||||
|
T1.characteristic
|
||||||
|
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>
|
||||||
|
<if test="tenantId!= null">
|
||||||
|
AND T1.tenant_id = #{tenantId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY T1.bus_no
|
||||||
|
LIMIT #{pageSize} OFFSET #{offset}
|
||||||
|
</select>
|
||||||
|
<select id="getOne" resultType="com.openhis.web.datadictionary.dto.MedicationManageDto">
|
||||||
|
SELECT T2.id,
|
||||||
|
T2.medication_def_id,
|
||||||
|
T2.status_enum,
|
||||||
|
T2.org_id,
|
||||||
|
T2.dose_form_code,
|
||||||
|
T2.total_volume,
|
||||||
|
T2.ingredient_item,
|
||||||
|
T2.active_flag,
|
||||||
|
T2.lot_number,
|
||||||
|
T2.effective_date,
|
||||||
|
T2.expiration_date,
|
||||||
|
T2.method_code,
|
||||||
|
T2.rate_code,
|
||||||
|
T2.dose,
|
||||||
|
T2.dose_unit_code,
|
||||||
|
T2.max_unit,
|
||||||
|
T2.definition,
|
||||||
|
T1.bus_no,
|
||||||
|
T1.name,
|
||||||
|
T1.domain_enum,
|
||||||
|
T1.version,
|
||||||
|
T1.name_en,
|
||||||
|
T1.py_str,
|
||||||
|
T1.wb_str,
|
||||||
|
T1.category_code,
|
||||||
|
T1.merchandise_name,
|
||||||
|
T1.merchandise_py_str,
|
||||||
|
T1.merchandise_wb_str,
|
||||||
|
T1.unit_code,
|
||||||
|
T1.min_unit_code,
|
||||||
|
T1.comprised_text,
|
||||||
|
T1.ingredient,
|
||||||
|
T1.part_percent,
|
||||||
|
T1.dose_from,
|
||||||
|
T1.approval_number,
|
||||||
|
T1.yb_match_flag,
|
||||||
|
T1.yb_no,
|
||||||
|
T1.pharmacology_category_code,
|
||||||
|
T1.skin_test_flag,
|
||||||
|
T1.inject_flag,
|
||||||
|
T1.manufacturer_id,
|
||||||
|
T1.supply_id,
|
||||||
|
T1.restricted_flag,
|
||||||
|
T1.restricted_scope,
|
||||||
|
T1.children_flag,
|
||||||
|
T1.characteristic
|
||||||
|
FROM med_medication_definition T1
|
||||||
|
LEFT JOIN med_medication T2 on T1.id = T2.medication_def_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>
|
||||||
|
<if test="tenantId!= null">
|
||||||
|
AND T1.tenant_id = #{tenantId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -32,7 +33,7 @@ public class Medication extends HisBaseEntity {
|
|||||||
private Long medicationDefId;
|
private Long medicationDefId;
|
||||||
|
|
||||||
/** 药品状态 */
|
/** 药品状态 */
|
||||||
private Integer statusEnum;
|
private PublicationStatus statusEnum;
|
||||||
|
|
||||||
/** 所属科室 */
|
/** 所属科室 */
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.openhis.medication.domain;
|
package com.openhis.medication.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -109,9 +108,6 @@ public class MedicationDefinition extends HisBaseEntity {
|
|||||||
/** 限制使用范围 */
|
/** 限制使用范围 */
|
||||||
private String restrictedScope;
|
private String restrictedScope;
|
||||||
|
|
||||||
/** 是否使用 */
|
|
||||||
private Integer activeFlag;
|
|
||||||
|
|
||||||
/** 儿童用药标志 */
|
/** 儿童用药标志 */
|
||||||
private Integer childrenFlag;
|
private Integer childrenFlag;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.medication.domain;
|
package com.openhis.medication.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
@@ -11,9 +14,6 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品信息详情
|
* 药品信息详情
|
||||||
*
|
*
|
||||||
@@ -30,7 +30,7 @@ public class MedicationDetail extends HisBaseEntity {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 药品编码 */
|
/** 药品编码 */
|
||||||
private Long medicationProductId;
|
private Long medicationDefId;
|
||||||
|
|
||||||
/** 药品状态 */
|
/** 药品状态 */
|
||||||
private Integer statusEnum;
|
private Integer statusEnum;
|
||||||
@@ -78,7 +78,7 @@ public class MedicationDetail extends HisBaseEntity {
|
|||||||
private String definition;
|
private String definition;
|
||||||
|
|
||||||
/** 药品编号 */
|
/** 药品编号 */
|
||||||
private Long code;
|
private String busNo;
|
||||||
|
|
||||||
/** 药品名称 */
|
/** 药品名称 */
|
||||||
private String name;
|
private String name;
|
||||||
@@ -93,10 +93,10 @@ public class MedicationDetail extends HisBaseEntity {
|
|||||||
private String nameEn;
|
private String nameEn;
|
||||||
|
|
||||||
/** 药品名称拼音码 */
|
/** 药品名称拼音码 */
|
||||||
private String pyCode;
|
private String pyStr;
|
||||||
|
|
||||||
/** 药品五笔码 */
|
/** 药品五笔码 */
|
||||||
private String wbCode;
|
private String wbStr;
|
||||||
|
|
||||||
/** 药品分类 */
|
/** 药品分类 */
|
||||||
private Integer categoryCode;
|
private Integer categoryCode;
|
||||||
@@ -105,10 +105,10 @@ public class MedicationDetail extends HisBaseEntity {
|
|||||||
private String merchandiseName;
|
private String merchandiseName;
|
||||||
|
|
||||||
/** 商品名称拼音码 */
|
/** 商品名称拼音码 */
|
||||||
private String merchandisePyCode;
|
private String merchandisePyStr;
|
||||||
|
|
||||||
/** 商品五笔码 */
|
/** 商品五笔码 */
|
||||||
private String merchandiseWbCode;
|
private String merchandiseWbStr;
|
||||||
|
|
||||||
/** 药品单位 */
|
/** 药品单位 */
|
||||||
private String unitCode;
|
private String unitCode;
|
||||||
@@ -135,7 +135,7 @@ public class MedicationDetail extends HisBaseEntity {
|
|||||||
private Integer ybMatchFlag;
|
private Integer ybMatchFlag;
|
||||||
|
|
||||||
/** 医保编码 */
|
/** 医保编码 */
|
||||||
private String ybCode;
|
private String ybNo;
|
||||||
|
|
||||||
/** 药理作用分类 */
|
/** 药理作用分类 */
|
||||||
private String pharmacologyCategoryCode;
|
private String pharmacologyCategoryCode;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.openhis.medication.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.openhis.medication.domain.MedicationDefinition;
|
import com.openhis.medication.domain.MedicationDefinition;
|
||||||
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品定义管理Service接口
|
* 药品定义管理Service接口
|
||||||
@@ -11,4 +12,19 @@ import com.openhis.medication.domain.MedicationDefinition;
|
|||||||
*/
|
*/
|
||||||
public interface IMedicationDefinitionService extends IService<MedicationDefinition> {
|
public interface IMedicationDefinitionService extends IService<MedicationDefinition> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增药品目录
|
||||||
|
*
|
||||||
|
* @param medicationDetail
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean addMedication(MedicationDetail medicationDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增医保药品目录
|
||||||
|
*
|
||||||
|
* @param medicationDetail
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean addYbMedicatione(MedicationDetail medicationDetail);
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.openhis.medication.service;
|
package com.openhis.medication.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.openhis.medication.domain.Medication;
|
import com.openhis.medication.domain.Medication;
|
||||||
import com.openhis.medication.domain.MedicationDetail;
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品基本信息管理Service接口
|
* 药品基本信息管理Service接口
|
||||||
*
|
*
|
||||||
@@ -28,4 +28,10 @@ public interface IMedicationService extends IService<Medication> {
|
|||||||
* @return 药品详细信息列表
|
* @return 药品详细信息列表
|
||||||
*/
|
*/
|
||||||
List<MedicationDetail> getDetailList();
|
List<MedicationDetail> getDetailList();
|
||||||
|
|
||||||
|
// 新增药品目录
|
||||||
|
boolean addMedication(MedicationDetail medicationDetail);
|
||||||
|
|
||||||
|
// 新增医保药品目录
|
||||||
|
boolean addYbMedicatione(MedicationDetail medicationDetail);
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,67 @@
|
|||||||
package com.openhis.medication.service.impl;
|
package com.openhis.medication.service.impl;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
import com.openhis.medication.domain.MedicationDefinition;
|
import com.openhis.medication.domain.MedicationDefinition;
|
||||||
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
import com.openhis.medication.mapper.MedicationDefinitionMapper;
|
import com.openhis.medication.mapper.MedicationDefinitionMapper;
|
||||||
import com.openhis.medication.service.IMedicationDefinitionService;
|
import com.openhis.medication.service.IMedicationDefinitionService;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品定义管理Service业务层处理
|
* 药品定义管理Service业务层处理
|
||||||
*
|
*
|
||||||
* @author system
|
* @author system
|
||||||
* @date 2025-02-20
|
* @date 2025-02-20
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class MedicationDefinitionServiceImpl extends ServiceImpl<MedicationDefinitionMapper, MedicationDefinition> implements IMedicationDefinitionService {
|
@AllArgsConstructor
|
||||||
|
public class MedicationDefinitionServiceImpl extends ServiceImpl<MedicationDefinitionMapper, MedicationDefinition>
|
||||||
|
implements IMedicationDefinitionService {
|
||||||
|
|
||||||
|
private final MedicationDefinitionMapper medicationDefinitionMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增药品目录
|
||||||
|
*
|
||||||
|
* @param medicationDetail
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean addMedication(MedicationDetail medicationDetail) {
|
||||||
|
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||||
|
BeanUtils.copyProperties(medicationDetail, medicationDefinition);
|
||||||
|
// 根据药品编码判断药品是否存在
|
||||||
|
List<MedicationDefinition> medicationDefinitions =
|
||||||
|
medicationDefinitionMapper.selectList(new LambdaQueryWrapper<MedicationDefinition>()
|
||||||
|
.eq(MedicationDefinition::getBusNo, medicationDefinition.getBusNo()));
|
||||||
|
if (medicationDefinitions.size() > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 新增药品目录
|
||||||
|
int insert = medicationDefinitionMapper.insert(medicationDefinition);
|
||||||
|
if (insert != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 获取生成的主键值
|
||||||
|
Long generatedId = medicationDefinition.getId();
|
||||||
|
// 将生成的 ID 存储到子表中
|
||||||
|
medicationDetail.setMedicationDefId(generatedId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addYbMedicatione(MedicationDetail medicationDetail) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,21 @@
|
|||||||
package com.openhis.medication.service.impl;
|
package com.openhis.medication.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
import com.openhis.common.enums.DelFlag;
|
import com.openhis.common.enums.DelFlag;
|
||||||
import com.openhis.medication.domain.Medication;
|
import com.openhis.medication.domain.Medication;
|
||||||
import com.openhis.medication.domain.MedicationDetail;
|
import com.openhis.medication.domain.MedicationDetail;
|
||||||
import com.openhis.medication.mapper.MedicationMapper;
|
import com.openhis.medication.mapper.MedicationMapper;
|
||||||
import com.openhis.medication.service.IMedicationService;
|
import com.openhis.medication.service.IMedicationService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 药品基本信息管理Service业务层处理
|
* 药品基本信息管理Service业务层处理
|
||||||
@@ -54,4 +58,39 @@ public class MedicationServiceImpl extends ServiceImpl<MedicationMapper, Medicat
|
|||||||
return medicationMapper.selectDetailList();
|
return medicationMapper.selectDetailList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增药品目录
|
||||||
|
*
|
||||||
|
* @param medicationDetail
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean addMedication(MedicationDetail medicationDetail) {
|
||||||
|
Medication medication = new Medication();
|
||||||
|
BeanUtils.copyProperties(medicationDetail, medication);
|
||||||
|
// 根据药品编码判断药品是否存在
|
||||||
|
List<Medication> medications = medicationMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<Medication>().eq(Medication::getMedicationDefId, medication.getMedicationDefId()));
|
||||||
|
if (medications.size() > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 新增药品目录
|
||||||
|
int insert = medicationMapper.insert(medication);
|
||||||
|
if (insert != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增药品目录
|
||||||
|
*
|
||||||
|
* @param medicationDetail
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean addYbMedicatione(MedicationDetail medicationDetail) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user