版本更新
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
|
||||
/**
|
||||
* 过敏与不耐受Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-03-07
|
||||
*/
|
||||
public interface IAllergyIntoleranceService extends IService<AllergyIntolerance> {
|
||||
|
||||
/**
|
||||
* 更新或者保存过敏与不耐受
|
||||
*
|
||||
* @param allergyIntolerance 过敏与不耐受实体
|
||||
*/
|
||||
boolean saveOrUpdateAllergyIntolerance(AllergyIntolerance allergyIntolerance);
|
||||
|
||||
/**
|
||||
* 根据药品请求id,获取皮试结果
|
||||
*
|
||||
* @param serviceRequestId 药品请求id
|
||||
* @return 皮试结果
|
||||
*/
|
||||
Integer getPsResultByRequestId(Long serviceRequestId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诊断定义管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IConditionDefinitionService extends IService<ConditionDefinition> {
|
||||
|
||||
/**
|
||||
* 新增病种
|
||||
*
|
||||
* @param conditionDefinition 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
boolean addDisease(ConditionDefinition conditionDefinition);
|
||||
|
||||
/**
|
||||
* 新增医保病种
|
||||
*
|
||||
* @param conditionDefinition 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
boolean addYbDisease(ConditionDefinition conditionDefinition);
|
||||
|
||||
/**
|
||||
* 根据id查询诊断定义
|
||||
*
|
||||
* @param collect id集合
|
||||
* @return 诊断定义集合
|
||||
*/
|
||||
List<ConditionDefinition> getConditionDefinitionListByIds(List<Long> collect);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.Condition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 疾病与诊断管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IConditionService extends IService<Condition> {
|
||||
|
||||
/**
|
||||
* 医生门诊就诊时保存诊断
|
||||
*
|
||||
* @param condition 诊断信息
|
||||
* @return 主键ID
|
||||
*/
|
||||
Long saveConditionByDoctor(Condition condition);
|
||||
|
||||
/**
|
||||
* 根据id查诊断集合
|
||||
* @param collect id集合
|
||||
* @return 诊断集合
|
||||
*/
|
||||
List<Condition> getConditionListById(List<Long> collect);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.clinical.domain.DiagnosisBelongBinding;
|
||||
|
||||
/**
|
||||
* 诊断归属绑定Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IDiagnosisBelongBindingService extends IService<DiagnosisBelongBinding> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.ProcedurePerformer;
|
||||
|
||||
/**
|
||||
* 手术与治疗执行人管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IProcedurePerformerService extends IService<ProcedurePerformer> {
|
||||
|
||||
/**
|
||||
* 添加执行人记录
|
||||
*
|
||||
* @param procedureId 执行记录id
|
||||
* @param now 执行时间
|
||||
* @return 添加结果
|
||||
*/
|
||||
boolean addPerformRecord(Long procedureId, Date now);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.Procedure;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.enums.ProcedureCategory;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
/**
|
||||
* 手术与治疗管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IProcedureService extends IService<Procedure> {
|
||||
|
||||
/**
|
||||
* 查询执行记录
|
||||
*
|
||||
* @param requestId 医嘱ids
|
||||
* @param requestTable 医嘱所在表
|
||||
* @return 执行记录
|
||||
*/
|
||||
List<Procedure> getProcedureRecords(List<Long> requestId, String requestTable);
|
||||
|
||||
/**
|
||||
* 添加执行记录
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param patientId 患者id
|
||||
* @param requestId 医嘱id
|
||||
* @param requestTable 医嘱所在表
|
||||
* @param eventStatus 执行状态
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @param groupId 组号
|
||||
* @param refundId 取消执行id
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Long groupId, Long refundId);
|
||||
|
||||
/**
|
||||
* 添加药品执行记录
|
||||
*
|
||||
* @param medicationRequest 药品医嘱
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean addMedicationProcedureRecord(MedicationRequest medicationRequest, ProcedureCategory procedureCategory,
|
||||
Long locationId);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.clinical.domain.ReservationRecord;
|
||||
|
||||
/**
|
||||
* 门诊预约记录Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IReservationRecordService extends IService<ReservationRecord> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import com.openhis.common.enums.ClinicalStatus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
import com.openhis.clinical.mapper.AllergyIntoleranceMapper;
|
||||
import com.openhis.clinical.service.IAllergyIntoleranceService;
|
||||
import com.openhis.common.enums.VerificationStatus;
|
||||
import com.openhis.workflow.mapper.ServiceRequestMapper;
|
||||
|
||||
/**
|
||||
* 过敏与不耐受Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-03-07
|
||||
*/
|
||||
@Service
|
||||
public class AllergyIntoleranceServiceImpl extends ServiceImpl<AllergyIntoleranceMapper, AllergyIntolerance>
|
||||
implements IAllergyIntoleranceService {
|
||||
|
||||
@Autowired
|
||||
ServiceRequestMapper serviceRequestMapper;
|
||||
|
||||
/**
|
||||
* 更新或者保存过敏与不耐受
|
||||
*
|
||||
* @param allergyIntolerance 过敏与不耐受实体
|
||||
*/
|
||||
@Override
|
||||
public boolean saveOrUpdateAllergyIntolerance(AllergyIntolerance allergyIntolerance) {
|
||||
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<AllergyIntolerance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AllergyIntolerance::getId, allergyIntolerance.getId()).eq(AllergyIntolerance::getPatientId,
|
||||
allergyIntolerance.getPatientId());
|
||||
|
||||
// 查询是否存在记录
|
||||
AllergyIntolerance existingEncounter = baseMapper.selectOne(queryWrapper);
|
||||
if (existingEncounter != null) {
|
||||
// 如果记录存在,更新记录
|
||||
allergyIntolerance.setId(existingEncounter.getId()); // 设置主键
|
||||
return baseMapper.updateById(allergyIntolerance) > 0;
|
||||
} else {
|
||||
// 如果记录不存在,插入新记录
|
||||
return baseMapper.insert(allergyIntolerance) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据药品请求id,获取皮试结果
|
||||
*
|
||||
* @param serviceRequestId 服务请求id
|
||||
* @return 皮试结果
|
||||
*/
|
||||
@Override
|
||||
public Integer getPsResultByRequestId(Long serviceRequestId) {
|
||||
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<AllergyIntolerance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AllergyIntolerance::getRequestId, serviceRequestId)
|
||||
// 皮试结果是已确认的
|
||||
.eq(AllergyIntolerance::getVerificationStatusEnum, VerificationStatus.CONFIRMED)
|
||||
.eq(AllergyIntolerance::getDeleteFlag, '0');
|
||||
// 根据服务请求id,获取皮试结果
|
||||
AllergyIntolerance allergyIntolerance = baseMapper.selectOne(queryWrapper);
|
||||
if (allergyIntolerance == null) {
|
||||
//没查到默认返回 未知
|
||||
return ClinicalStatus.UNKNOWN.getValue();
|
||||
}
|
||||
return allergyIntolerance.getVerificationStatusEnum();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
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.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.mapper.ConditionDefinitionMapper;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 诊断定义管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ConditionDefinitionServiceImpl extends ServiceImpl<ConditionDefinitionMapper, ConditionDefinition>
|
||||
implements IConditionDefinitionService {
|
||||
|
||||
private final ConditionDefinitionMapper conditionDefinitionMapper;
|
||||
|
||||
/**
|
||||
* 新增病种
|
||||
*
|
||||
* @param conditionDefinition 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addDisease(ConditionDefinition conditionDefinition) {
|
||||
// 根据病种编码判断病种是否存在
|
||||
List<ConditionDefinition> conditionDefinitions =
|
||||
conditionDefinitionMapper.selectList(new LambdaQueryWrapper<ConditionDefinition>()
|
||||
.eq(ConditionDefinition::getConditionCode, conditionDefinition.getConditionCode()));
|
||||
if (conditionDefinitions.size() > 0) {
|
||||
return false;
|
||||
}
|
||||
// 新增病种
|
||||
int insert = conditionDefinitionMapper.insert(conditionDefinition);
|
||||
return insert == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增医保病种
|
||||
*
|
||||
* @param conditionDefinition 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean addYbDisease(ConditionDefinition conditionDefinition) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询诊断定义
|
||||
*
|
||||
* @param collect id集合
|
||||
* @return 诊断定义集合
|
||||
*/
|
||||
@Override
|
||||
public List<ConditionDefinition> getConditionDefinitionListByIds(List<Long> collect) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ConditionDefinition>()
|
||||
.in(ConditionDefinition::getId, collect).eq(ConditionDefinition::getDescription, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.clinical.domain.Condition;
|
||||
import com.openhis.clinical.mapper.ConditionMapper;
|
||||
import com.openhis.clinical.service.IConditionService;
|
||||
|
||||
/**
|
||||
* 疾病与诊断管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ConditionServiceImpl extends ServiceImpl<ConditionMapper, Condition> implements IConditionService {
|
||||
|
||||
/**
|
||||
* 医生门诊就诊时保存诊断
|
||||
*
|
||||
* @param condition 诊断信息
|
||||
* @return 主键ID
|
||||
*/
|
||||
@Override
|
||||
public Long saveConditionByDoctor(Condition condition) {
|
||||
condition.setRecordedDatetime(new Date());
|
||||
condition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
|
||||
if (condition.getId() == null) {
|
||||
baseMapper.insert(condition);
|
||||
} else {
|
||||
baseMapper.updateById(condition);
|
||||
}
|
||||
return condition.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查诊断集合
|
||||
*
|
||||
* @param collect id集合
|
||||
* @return 诊断集合
|
||||
*/
|
||||
@Override
|
||||
public List<Condition> getConditionListById(List<Long> collect) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Condition>().in(Condition::getId, collect)
|
||||
.eq(Condition::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.clinical.domain.DiagnosisBelongBinding;
|
||||
import com.openhis.clinical.mapper.DiagnosisBelongBindingMapper;
|
||||
import com.openhis.clinical.service.IDiagnosisBelongBindingService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 诊断归属绑定Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class DiagnosisBelongBindingServiceImpl extends ServiceImpl<DiagnosisBelongBindingMapper, DiagnosisBelongBinding>
|
||||
implements IDiagnosisBelongBindingService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.clinical.domain.ProcedurePerformer;
|
||||
import com.openhis.clinical.mapper.ProcedurePerformerMapper;
|
||||
import com.openhis.clinical.service.IProcedurePerformerService;
|
||||
|
||||
/**
|
||||
* 手术与治疗执行人管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ProcedurePerformerServiceImpl extends ServiceImpl<ProcedurePerformerMapper, ProcedurePerformer>
|
||||
implements IProcedurePerformerService {
|
||||
|
||||
@Override
|
||||
public boolean addPerformRecord(Long procedureId, Date now) {
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
ProcedurePerformer procedurePerformer = new ProcedurePerformer();
|
||||
procedurePerformer
|
||||
// 执行记录id
|
||||
.setProcedureId(procedureId)
|
||||
// 执行开始时间
|
||||
.setStartTime(now)
|
||||
// 执行人
|
||||
.setPractitionerId(practitionerId);
|
||||
int result = baseMapper.insert(procedurePerformer);
|
||||
return result > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.clinical.domain.Procedure;
|
||||
import com.openhis.clinical.mapper.ProcedureMapper;
|
||||
import com.openhis.clinical.service.IProcedurePerformerService;
|
||||
import com.openhis.clinical.service.IProcedureService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.enums.ProcedureCategory;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
/**
|
||||
* 手术与治疗管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ProcedureServiceImpl extends ServiceImpl<ProcedureMapper, Procedure> implements IProcedureService {
|
||||
|
||||
@Resource
|
||||
private IProcedurePerformerService procedurePerformerService;
|
||||
|
||||
/**
|
||||
* 查询执行记录
|
||||
*
|
||||
* @param requestIds 医嘱ids
|
||||
* @param requestTable 医嘱所在表
|
||||
* @return 执行记录
|
||||
*/
|
||||
@Override
|
||||
public List<Procedure> getProcedureRecords(List<Long> requestIds, String requestTable) {
|
||||
LambdaQueryWrapper<Procedure> queryWrapper = new LambdaQueryWrapper<Procedure>()
|
||||
.in(Procedure::getRequestId, requestIds).eq(Procedure::getDeleteFlag, DelFlag.NO.getCode());
|
||||
if (requestTable != null) {
|
||||
queryWrapper.eq(Procedure::getRequestTable, requestTable);
|
||||
}
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行记录
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param patientId 患者id
|
||||
* @param requestId 医嘱id
|
||||
* @param requestTable 医嘱所在表
|
||||
* @param eventStatus 执行状态
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @param groupId 组号
|
||||
* @param refundId 取消执行id
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Long groupId, Long refundId) {
|
||||
Date now = DateUtils.getNowDate();
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Procedure procedure = new Procedure();
|
||||
procedure
|
||||
// 医嘱id
|
||||
.setRequestId(requestId)
|
||||
// 医嘱所在表
|
||||
.setRequestTable(requestTable)
|
||||
// 就诊id
|
||||
.setEncounterId(encounterId)
|
||||
// 执行科室
|
||||
.setOrgId(orgId)
|
||||
// 患者id
|
||||
.setPatientId(patientId)
|
||||
// 执行时间
|
||||
.setOccurrenceTime(now)
|
||||
// 执行状态
|
||||
.setStatusEnum(eventStatus.getValue())
|
||||
// 执行种类
|
||||
.setCategoryEnum(procedureCategory.getValue());
|
||||
if (locationId != null) {
|
||||
// 执行位置
|
||||
procedure.setLocationId(locationId);
|
||||
}
|
||||
if (groupId != null) {
|
||||
// 组号
|
||||
procedure.setGroupId(groupId);
|
||||
}
|
||||
if (refundId != null) {
|
||||
procedure.setRefundId(refundId);
|
||||
}
|
||||
int result = baseMapper.insert(procedure);
|
||||
if (result > 0) {
|
||||
// 添加执行人子表
|
||||
return procedurePerformerService.addPerformRecord(procedure.getId(), now);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加药品执行记录
|
||||
*
|
||||
* @param medicationRequest 药品医嘱
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean addMedicationProcedureRecord(MedicationRequest medicationRequest,
|
||||
ProcedureCategory procedureCategory, Long locationId) {
|
||||
Date now = DateUtils.getNowDate();
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Procedure procedure = new Procedure();
|
||||
procedure
|
||||
// 药品医嘱id
|
||||
.setRequestId(medicationRequest.getId())
|
||||
// 药品申请表
|
||||
.setRequestTable(CommonConstants.TableName.MED_MEDICATION_REQUEST)
|
||||
// 就诊id
|
||||
.setEncounterId(medicationRequest.getEncounterId())
|
||||
// 执行科室
|
||||
.setOrgId(orgId)
|
||||
// 患者id
|
||||
.setPatientId(medicationRequest.getPatientId())
|
||||
// 执行时间
|
||||
.setOccurrenceTime(now)
|
||||
// 执行种类
|
||||
.setCategoryEnum(procedureCategory.getValue())
|
||||
// 执行位置
|
||||
.setLocationId(locationId);
|
||||
int result = baseMapper.insert(procedure);
|
||||
if (result > 0) {
|
||||
// 添加执行人子表
|
||||
return procedurePerformerService.addPerformRecord(procedure.getId(), now);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.openhis.clinical.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.clinical.domain.ReservationRecord;
|
||||
import com.openhis.clinical.mapper.ReservationRecordMapper;
|
||||
import com.openhis.clinical.service.IReservationRecordService;
|
||||
|
||||
/**
|
||||
* 门诊预约记录Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ReservationRecordServiceImpl extends ServiceImpl<ReservationRecordMapper, ReservationRecord>
|
||||
implements IReservationRecordService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user