版本更新
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
package com.openhis.medication.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 药品基本信息管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("med_medication")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Medication extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 药品状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/** 剂型 */
|
||||
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;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** 用量限定 */
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** DDD值 */
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
private String dddUnitCode;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
private String maxRateCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.openhis.medication.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 药品定义管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("med_medication_definition")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MedicationDefinition extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 药品编号 */
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
private Integer domainEnum;
|
||||
|
||||
/** 药品版本 */
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
private String categoryCode;
|
||||
|
||||
/** 商品名称 */
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
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 String manufacturerText;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplyId;
|
||||
|
||||
/** 是否限制使用 */
|
||||
private Integer restrictedFlag;
|
||||
|
||||
/** 限制使用范围 */
|
||||
private String restrictedScope;
|
||||
|
||||
/** 是否使用 */
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
private Integer childrenFlag;
|
||||
|
||||
/** 产品特性 */
|
||||
private Integer characteristic;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 默认门诊单位 */
|
||||
private String defEncounterUnitCode;
|
||||
|
||||
/** 默认住院单位 */
|
||||
private String defInhospitalUnitCode;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
private Integer partAttributeEnum;
|
||||
|
||||
/** 抗生素分类 */
|
||||
private String antibioticCode;
|
||||
|
||||
/** 权限限制 */
|
||||
private Integer restrictedEnum;
|
||||
|
||||
/** 是否自制 */
|
||||
private Integer selfFlag;
|
||||
|
||||
/** 是否抗生素 */
|
||||
private Integer antibioticFlag;
|
||||
|
||||
/** 基药标识 */
|
||||
private Integer basicFlag;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
private Integer thoPartAttributeEnum;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.medication.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 药品信息详情
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MedicationDetail extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 药品状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 所属科室 */
|
||||
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;
|
||||
|
||||
/** 药品编号 */
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
private Integer domainEnum;
|
||||
|
||||
/** 药品版本 */
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
private String categoryCode;
|
||||
|
||||
/** 商品名称 */
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
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;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
private Integer partAttributeEnum;
|
||||
|
||||
/** DDD值 */
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
private String dddUnitCode;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
private String maxRateCode;
|
||||
/** 抗生素分类 */
|
||||
private String antibioticCode;
|
||||
/** 权限限制 */
|
||||
private Integer restrictedEnum;
|
||||
/** 是否自制 */
|
||||
private Integer selfFlag;
|
||||
/** 是否抗生素 */
|
||||
private Integer antibioticFlag;
|
||||
/** 基药标识 */
|
||||
private Integer basicFlag;
|
||||
/** 生产厂商文本 */
|
||||
private String manufacturerText;
|
||||
/** 用量限定 */
|
||||
private BigDecimal usageLimit;
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
private Integer thoPartAttributeEnum;
|
||||
/** 剂量单位换算比 */
|
||||
private BigDecimal unitConversionRatio;
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.openhis.medication.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 药品发放管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("med_medication_dispense")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MedicationDispense extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 药品发放id */
|
||||
private String busNo;
|
||||
|
||||
/** 药品发放状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 未发药原因 */
|
||||
private Integer notPerformedReasonEnum;
|
||||
|
||||
/** 状态变更时间 */
|
||||
private Date statusChangedTime;
|
||||
|
||||
/** 发药类型 */
|
||||
private Integer dispenseEnum;
|
||||
|
||||
/** 药品编码 */
|
||||
private Long medicationId;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 相关诊疗 */
|
||||
private Long encounterId;
|
||||
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
/** 发药人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 发放药房 */
|
||||
private Long locationId;
|
||||
|
||||
/** 药品请求id */
|
||||
private Long medReqId;
|
||||
|
||||
/** 发药类型 */
|
||||
private String partTypeCode;
|
||||
|
||||
/** 已发药数量 */
|
||||
private Integer dispenseQuantity;
|
||||
|
||||
/** 发药频次 */
|
||||
private String dispenseFrequencyCode;
|
||||
|
||||
/** 配药人 */
|
||||
private Long preparerId;
|
||||
|
||||
/** 配药时间 */
|
||||
private Date prepareTime;
|
||||
|
||||
/** 发药时间 */
|
||||
private Date dispenseTime;
|
||||
|
||||
/** 限制发药时间 */
|
||||
private Date limitTime;
|
||||
|
||||
/** 预定发药时间 */
|
||||
private Date plannedDispenseTime;
|
||||
|
||||
/** 发药目的地 */
|
||||
private String desLocationId;
|
||||
|
||||
/** 接收人 */
|
||||
private String recPractitionerId;
|
||||
|
||||
/** 用药说明 */
|
||||
private String dosageInstruction;
|
||||
|
||||
/** 用法 */
|
||||
private String methodCode;
|
||||
|
||||
/** 用药频次 */
|
||||
private String frequencyCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
private String doseUnitCode;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 发放数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 发放单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
package com.openhis.medication.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 药品请求管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("med_medication_request")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MedicationRequest extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 药品请求编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 分组id */
|
||||
private Long groupId;
|
||||
|
||||
/** 组套id */
|
||||
private Long packageId;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeNum;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 药品请求状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 状态原因 */
|
||||
private Integer statusReason;
|
||||
|
||||
/** 状态变更时间 */
|
||||
private Date statusChangedTime;
|
||||
|
||||
/** 请求意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先级 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 是否停止执行 */
|
||||
private Integer performFlag;
|
||||
|
||||
/** 药品定义id */
|
||||
private Long medicationId;
|
||||
|
||||
/** 患者 */
|
||||
private Long patientId;
|
||||
|
||||
/** 开方医生 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 所在位置 */
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 发放药房
|
||||
*/
|
||||
private Long performLocation;
|
||||
|
||||
/** 开方人科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
/** 请求开始时间 */
|
||||
private Date reqAuthoredTime;
|
||||
|
||||
/** 是否报告 */
|
||||
private Integer reportFlag;
|
||||
|
||||
/** 执行人类型 */
|
||||
private Integer performerEnum;
|
||||
|
||||
/** 执行人 */
|
||||
private Long performerId;
|
||||
|
||||
/** 执行科室 */
|
||||
private Long performOrg;
|
||||
|
||||
/** 设备id */
|
||||
private Long deviceDefId;
|
||||
|
||||
/** 记录人 */
|
||||
private Long recorderId;
|
||||
|
||||
/** 请求原因 */
|
||||
private String reasonJson;
|
||||
|
||||
/** 治疗类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 服药时间(开始) */
|
||||
private Date effectiveDoseStart;
|
||||
|
||||
/** 服药时间(结束) */
|
||||
private Date effectiveDoseEnd;
|
||||
|
||||
/** 皮试标志 */
|
||||
private Integer skinTestFlag;
|
||||
|
||||
/** 合同Id */
|
||||
private String contractNo;
|
||||
|
||||
/** 输液标志 */
|
||||
private Integer infusionFlag;
|
||||
|
||||
/** 用法 */
|
||||
private String methodCode;
|
||||
|
||||
/** 用药频次 */
|
||||
private String rateCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
private String doseUnitCode;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
private BigDecimal maxDose;
|
||||
|
||||
/** 首次用量 */
|
||||
private BigDecimal firstDose;
|
||||
|
||||
/** 首次持续时间 */
|
||||
private String firstDuration;
|
||||
|
||||
/** 给药间隔 */
|
||||
private String dispenseInterval;
|
||||
|
||||
/** 单次发药数 */
|
||||
private Integer dispensePerQuantity;
|
||||
|
||||
/** 每次发药供应天数 */
|
||||
private Integer dispensePerDuration;
|
||||
|
||||
/** 输液速度 */
|
||||
private Integer speed;
|
||||
|
||||
/** 退药id */
|
||||
private Long refundMedicineId;
|
||||
|
||||
/** 处方类别 */
|
||||
private String rxTypeCode;
|
||||
|
||||
/**
|
||||
* 请求内容json
|
||||
*/
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 中药付数
|
||||
*/
|
||||
private Integer chineseHerbsDoseQuantity;
|
||||
|
||||
/**
|
||||
* 代煎标识 | 0:否 , 1:是
|
||||
*/
|
||||
private Integer sufferingFlag;
|
||||
|
||||
/**
|
||||
* 中医标识
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer sortNumber;
|
||||
|
||||
/** 校对人 */
|
||||
private Long performerCheckId;
|
||||
|
||||
/** 校对时间 */
|
||||
private Date checkTime;
|
||||
|
||||
/**
|
||||
* 签发编码
|
||||
*/
|
||||
private String signCode;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.medication.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
|
||||
/**
|
||||
* 药品定义管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface MedicationDefinitionMapper extends BaseMapper<MedicationDefinition> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.medication.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
|
||||
/**
|
||||
* 药品发放管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface MedicationDispenseMapper extends BaseMapper<MedicationDispense> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.medication.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 药品基本信息管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface MedicationMapper extends BaseMapper<Medication> {
|
||||
|
||||
/**
|
||||
* 查询药品详细信息列表
|
||||
*
|
||||
* @return 药品详细信息列表
|
||||
*/
|
||||
List<MedicationDetail> selectDetailList();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.medication.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
/**
|
||||
* 药品请求管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface MedicationRequestMapper extends BaseMapper<MedicationRequest> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
|
||||
/**
|
||||
* 药品定义管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IMedicationDefinitionService extends IService<MedicationDefinition> {
|
||||
|
||||
/**
|
||||
* 新增药品目录
|
||||
*
|
||||
* @param medicationDetail
|
||||
* @return
|
||||
*/
|
||||
boolean addMedication(MedicationDetail medicationDetail);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 药品发放管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IMedicationDispenseService extends IService<MedicationDispense> {
|
||||
|
||||
/**
|
||||
* 处理药品发放信息
|
||||
*
|
||||
* @param medicationRequest 药品请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
*
|
||||
* @param medReqId 药品请求id
|
||||
*/
|
||||
void deleteMedicationDispense(Long medReqId);
|
||||
|
||||
/**
|
||||
* 更新未发放药品状态:停止发放
|
||||
*
|
||||
* @param medDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> medDisIdList, Integer refund);
|
||||
|
||||
/**
|
||||
* 更新药品状态:待配药
|
||||
*
|
||||
* @param medicationRequestIdList 请求id列表
|
||||
*/
|
||||
void updatePreparationDispenseStatus(List<Long> medicationRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新药品状态:暂停
|
||||
*
|
||||
* @param medReqIdList 请求id列表
|
||||
*/
|
||||
void updateOnHoldDispenseStatus(List<Long> medReqIdList);
|
||||
|
||||
/**
|
||||
* 验证是否发过药
|
||||
*
|
||||
* @param medicationDefId 药品定义id
|
||||
* @return 验证结果
|
||||
*/
|
||||
boolean verifyAbleEdit(Long medicationDefId);
|
||||
|
||||
/**
|
||||
* 通过请求id获取药品发放信息
|
||||
*
|
||||
* @param requestIdList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> selectByRequestIdList(List<Long> requestIdList);
|
||||
/**
|
||||
* 通过id获取药品发放信息
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> selectByIdList(@Param("idList") List<Long> idList);
|
||||
|
||||
/**
|
||||
* 更新药品状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> medDispenseId);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
/**
|
||||
* 药品请求管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IMedicationRequestService extends IService<MedicationRequest> {
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate);
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate);
|
||||
|
||||
/**
|
||||
* 通过id获取药品请求信息
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationRequest> selectByIdList(@Param("idList") List<Long> idList);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
|
||||
/**
|
||||
* 药品基本信息管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IMedicationService extends IService<Medication> {
|
||||
|
||||
/**
|
||||
* 查询药品信息列表
|
||||
*
|
||||
* @param medicationIdList 药品id列表
|
||||
* @return 药品信息列表
|
||||
*/
|
||||
List<Medication> getList(List<Long> medicationIdList);
|
||||
|
||||
/**
|
||||
* 查询药品详细信息列表
|
||||
*
|
||||
* @return 药品详细信息列表
|
||||
*/
|
||||
List<MedicationDetail> getDetailList();
|
||||
|
||||
// 新增药品目录
|
||||
boolean addMedication(MedicationDetail medicationDetail);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.openhis.medication.service.impl;
|
||||
|
||||
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.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
import com.openhis.medication.mapper.MedicationDefinitionMapper;
|
||||
import com.openhis.medication.service.IMedicationDefinitionService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 药品定义管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@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);
|
||||
medicationDetail.setId(medicationDefinition.getId());
|
||||
|
||||
if (insert != 1) {
|
||||
return false;
|
||||
}
|
||||
// 获取生成的主键值
|
||||
Long generatedId = medicationDefinition.getId();
|
||||
// 将生成的 ID 存储到子表中
|
||||
medicationDetail.setMedicationDefId(generatedId);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.openhis.medication.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
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.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DbOpType;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.mapper.MedicationDispenseMapper;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
|
||||
/**
|
||||
* 药品发放管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispenseMapper, MedicationDispense>
|
||||
implements IMedicationDispenseService {
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 处理药品发放信息
|
||||
*
|
||||
* @param medicationRequest 药品请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
@Override
|
||||
public void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType) {
|
||||
MedicationDispense medicationDispense = new MedicationDispense();
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 药品发放状态
|
||||
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(medicationRequest.getPractitionerId());
|
||||
// 发放药房
|
||||
medicationDispense.setLocationId(medicationRequest.getPerformLocation());
|
||||
// 药品请求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());
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加2小时
|
||||
LocalDateTime newTime = now.plusHours(2);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
medicationDispense.setLimitTime(limitTime);
|
||||
|
||||
if (DbOpType.INSERT.getCode().equals(dbOpType)) {
|
||||
baseMapper.insert(medicationDispense);
|
||||
} else if (DbOpType.UPDATE.getCode().equals(dbOpType)) {
|
||||
baseMapper.update(medicationDispense, new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.eq(MedicationDispense::getMedReqId, medicationRequest.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
*
|
||||
* @param medReqId 药品请求id
|
||||
*/
|
||||
@Override
|
||||
public void deleteMedicationDispense(Long medReqId) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getMedReqId, medReqId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新未发放药品状态:停止发放
|
||||
*
|
||||
* @param medDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
@Override
|
||||
public void updateStopDispenseStatus(List<Long> medDisIdList, Integer refund) {
|
||||
baseMapper.update(
|
||||
new MedicationDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund),
|
||||
new LambdaUpdateWrapper<MedicationDispense>().in(MedicationDispense::getId, medDisIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:待配药
|
||||
*
|
||||
* @param medicationRequestIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updatePreparationDispenseStatus(List<Long> medicationRequestIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getMedReqId, medicationRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:暂停
|
||||
*
|
||||
* @param medReqIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateOnHoldDispenseStatus(List<Long> medReqIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.ON_HOLD.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getMedReqId, medReqIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否发过药
|
||||
*
|
||||
* @param medicationDefId 药品定义id
|
||||
* @return 验证结果
|
||||
*/
|
||||
@Override
|
||||
public boolean verifyAbleEdit(Long medicationDefId) {
|
||||
return baseMapper.exists(
|
||||
new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getMedicationId, medicationDefId)
|
||||
.and(q -> q.eq(MedicationDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue()).or()
|
||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.REFUNDED.getValue()))
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
/**
|
||||
* 通过请求id获取药品发放信息
|
||||
*
|
||||
* @param requestIdList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationDispense> selectByRequestIdList(List<Long> requestIdList){
|
||||
return baseMapper.selectList( new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getMedReqId, requestIdList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取药品发放信息
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationDispense> selectByIdList(@Param("idList") List<Long> idList){
|
||||
return baseMapper.selectList( new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getId, idList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDispenseStatusSummarized(List<Long> medDispenseId){
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getId, medDispenseId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.openhis.medication.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
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.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.mapper.MedicationRequestMapper;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
|
||||
/**
|
||||
* 药品请求管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestMapper, MedicationRequest>
|
||||
implements IMedicationRequestService {
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate) {
|
||||
baseMapper.update(new MedicationRequest().setStatusEnum(RequestStatus.COMPLETED.getValue()),
|
||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param requestIdList 药品请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate) {
|
||||
LambdaUpdateWrapper<MedicationRequest> updateWrapper =
|
||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.DRAFT.getValue());
|
||||
if (practitionerId != null) {
|
||||
updateWrapper.set(MedicationRequest::getPerformerCheckId, practitionerId);
|
||||
}
|
||||
if (checkDate != null) {
|
||||
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
||||
}
|
||||
baseMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取药品请求信息
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationRequest> selectByIdList(@Param("idList") List<Long> idList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getId, idList)
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
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.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
import com.openhis.medication.mapper.MedicationMapper;
|
||||
import com.openhis.medication.service.IMedicationService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 药品基本信息管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MedicationServiceImpl extends ServiceImpl<MedicationMapper, Medication> implements IMedicationService {
|
||||
|
||||
@Autowired
|
||||
private MedicationMapper medicationMapper;
|
||||
|
||||
/**
|
||||
* 查询药品信息列表
|
||||
*
|
||||
* @param medicationIdList 药品id列表
|
||||
* @return 药品信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<Medication> getList(List<Long> medicationIdList) {
|
||||
|
||||
// 判断是否为空
|
||||
if (!medicationIdList.isEmpty()) {
|
||||
// 查询药品相关信息列表并返回
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Medication>()
|
||||
.eq(Medication::getDeleteFlag, DelFlag.NO.getValue()).in(Medication::getId, medicationIdList));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品详细信息列表
|
||||
*
|
||||
* @return 药品详细信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationDetail> getDetailList() {
|
||||
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.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// 新增药品目录
|
||||
int insert = medicationMapper.insert(medication);
|
||||
if (insert != 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user