提交merge1.3
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.openhis.clinical.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
|
||||
/**
|
||||
@@ -12,19 +11,4 @@ import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
*/
|
||||
public interface IAllergyIntoleranceService extends IService<AllergyIntolerance> {
|
||||
|
||||
/**
|
||||
* 更新或者保存过敏与不耐受
|
||||
*
|
||||
* @param allergyIntolerance 过敏与不耐受实体
|
||||
*/
|
||||
boolean saveOrUpdateAllergyIntolerance(AllergyIntolerance allergyIntolerance);
|
||||
|
||||
/**
|
||||
* 根据药品请求id,获取皮试结果
|
||||
*
|
||||
* @param serviceRequestId 药品请求id
|
||||
* @return 皮试结果
|
||||
*/
|
||||
Integer getPsResultByRequestId(Long serviceRequestId);
|
||||
|
||||
}
|
||||
@@ -36,14 +36,15 @@ public interface IProcedureService extends IService<Procedure> {
|
||||
* @param eventStatus 执行状态
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @param expectedDate 预计执行时间
|
||||
* @param exeDate 执行时间
|
||||
* @param groupId 组号
|
||||
* @param refundId 取消执行id
|
||||
* @return 执行id
|
||||
*/
|
||||
Long addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId,
|
||||
Long refundId);
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date expectedDate, Date exeDate,
|
||||
Long groupId, Long refundId);
|
||||
|
||||
/**
|
||||
* 添加药品执行记录
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
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业务层处理
|
||||
@@ -22,55 +17,4 @@ import com.openhis.workflow.mapper.ServiceRequestMapper;
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ 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 com.openhis.common.enums.DelFlag;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@@ -9,6 +9,7 @@ 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.enums.DelFlag;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.clinical.domain.Procedure;
|
||||
@@ -16,7 +17,6 @@ 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;
|
||||
@@ -60,15 +60,16 @@ public class ProcedureServiceImpl extends ServiceImpl<ProcedureMapper, Procedure
|
||||
* @param eventStatus 执行状态
|
||||
* @param procedureCategory 执行种类
|
||||
* @param locationId 执行位置
|
||||
* @param expectedDate 预计执行时间
|
||||
* @param exeDate 执行时间
|
||||
* @param groupId 组号
|
||||
* @param refundId 取消执行id
|
||||
* @return 是否成功
|
||||
* @return 执行id
|
||||
*/
|
||||
@Override
|
||||
public Long addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId,
|
||||
Long refundId) {
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date expectedDate, Date exeDate,
|
||||
Long groupId, Long refundId) {
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Procedure procedure = new Procedure();
|
||||
procedure
|
||||
@@ -82,8 +83,10 @@ public class ProcedureServiceImpl extends ServiceImpl<ProcedureMapper, Procedure
|
||||
.setOrgId(orgId)
|
||||
// 患者id
|
||||
.setPatientId(patientId)
|
||||
// 预计执行时间
|
||||
.setOccurrenceTime(expectedDate)
|
||||
// 执行时间
|
||||
.setOccurrenceTime(exeDate)
|
||||
.setRecordedTime(exeDate)
|
||||
// 执行状态
|
||||
.setStatusEnum(eventStatus.getValue())
|
||||
// 执行种类
|
||||
|
||||
Reference in New Issue
Block a user