91 分诊排队管理-》门诊医生站:【完诊】患者队列状态的变化
68 检验项目设置-检验类型 / 检验项目设置-检验项目
This commit is contained in:
12
openhis-server-new/add_fields_to_activity_definition.sql
Normal file
12
openhis-server-new/add_fields_to_activity_definition.sql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
-- 为诊疗定义表添加序号和服务范围字段
|
||||||
|
-- 执行前请先备份数据库
|
||||||
|
|
||||||
|
ALTER TABLE wor_activity_definition ADD COLUMN IF NOT EXISTS sort_order INTEGER DEFAULT NULL;
|
||||||
|
ALTER TABLE wor_activity_definition ADD COLUMN IF NOT EXISTS service_range VARCHAR(50) DEFAULT '全部';
|
||||||
|
|
||||||
|
-- 添加注释
|
||||||
|
COMMENT ON COLUMN wor_activity_definition.sort_order IS '序号';
|
||||||
|
COMMENT ON COLUMN wor_activity_definition.service_range IS '服务范围';
|
||||||
|
|
||||||
|
-- 为现有数据设置默认值
|
||||||
|
UPDATE wor_activity_definition SET service_range = '全部' WHERE service_range IS NULL;
|
||||||
@@ -28,7 +28,10 @@ import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
|
|||||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||||
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -45,6 +48,8 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class LisConfigManageAppServiceImpl implements ILisConfigManageAppService {
|
public class LisConfigManageAppServiceImpl implements ILisConfigManageAppService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(LisConfigManageAppServiceImpl.class);
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -120,14 +125,46 @@ public class LisConfigManageAppServiceImpl implements ILisConfigManageAppServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public R<?> saveAll(LisConfigManageDto manageDto) {
|
public R<?> saveAll(LisConfigManageDto manageDto) {
|
||||||
//先全部删除项目下详情
|
try {
|
||||||
|
// 先全部删除项目下详情
|
||||||
activityDefDeviceDefMapper.delete(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", manageDto.getId()));
|
activityDefDeviceDefMapper.delete(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", manageDto.getId()));
|
||||||
activityDefObservationDefMapper.delete(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", manageDto.getId()));
|
activityDefObservationDefMapper.delete(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", manageDto.getId()));
|
||||||
activityDefSpecimenDefMapper.delete(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", manageDto.getId()));
|
activityDefSpecimenDefMapper.delete(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", manageDto.getId()));
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
|
||||||
|
// 获取租户ID并验证
|
||||||
|
Integer tenantId = null;
|
||||||
|
try {
|
||||||
|
tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取租户ID失败,使用默认值", e);
|
||||||
|
}
|
||||||
|
|
||||||
// 根据ID查询【诊疗目录】详情
|
// 根据ID查询【诊疗目录】详情
|
||||||
DiagnosisTreatmentDto diseaseTreatmentOne = activityDefinitionManageMapper.getDiseaseTreatmentOne(manageDto.getId(), tenantId);
|
DiagnosisTreatmentDto diseaseTreatmentOne = activityDefinitionManageMapper.getDiseaseTreatmentOne(manageDto.getId(), tenantId);
|
||||||
|
if (diseaseTreatmentOne == null) {
|
||||||
|
log.warn("未找到诊疗目录:id={}, tenantId={}", manageDto.getId(), tenantId);
|
||||||
|
// 即使未找到诊疗目录,也继续保存,使用ID作为名称
|
||||||
|
String activityDefinitionName = String.valueOf(manageDto.getId());
|
||||||
|
|
||||||
|
manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
|
||||||
|
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
||||||
|
activityDefDeviceDef.setActivityDefinitionName(activityDefinitionName);
|
||||||
|
activityDefDeviceDefMapper.insert(activityDefDeviceDef);
|
||||||
|
});
|
||||||
|
manageDto.getActivityDefObservationDefs().forEach(activityDefObservationDef -> {
|
||||||
|
activityDefObservationDef.setActivityDefinitionId(manageDto.getId());
|
||||||
|
activityDefObservationDef.setActivityDefinitionName(activityDefinitionName);
|
||||||
|
activityDefObservationDefMapper.insert(activityDefObservationDef);
|
||||||
|
});
|
||||||
|
manageDto.getActivityDefSpecimenDefs().forEach(activityDefSpecimenDef -> {
|
||||||
|
activityDefSpecimenDef.setActivityDefinitionId(manageDto.getId());
|
||||||
|
activityDefSpecimenDef.setActivityDefinitionName(activityDefinitionName);
|
||||||
|
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 正常保存
|
||||||
manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
|
manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
|
||||||
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
||||||
activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||||
@@ -143,8 +180,18 @@ public class LisConfigManageAppServiceImpl implements ILisConfigManageAppServic
|
|||||||
activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||||
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return R.ok();
|
log.info("保存检验项目设置成功:id={}, deviceCount={}, observationCount={}, specimenCount={}",
|
||||||
|
manageDto.getId(),
|
||||||
|
manageDto.getActivityDefDeviceDefs().size(),
|
||||||
|
manageDto.getActivityDefObservationDefs().size(),
|
||||||
|
manageDto.getActivityDefSpecimenDefs().size());
|
||||||
|
return R.ok("保存成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("保存检验项目设置失败:id={}, error={}", manageDto.getId(), e.getMessage(), e);
|
||||||
|
return R.fail("保存失败:" + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import com.openhis.web.Inspection.dto.ObservationDefManageDto;
|
|||||||
import com.openhis.web.Inspection.dto.ObservationDefManageInitDto;
|
import com.openhis.web.Inspection.dto.ObservationDefManageInitDto;
|
||||||
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -42,6 +44,8 @@ import java.util.stream.Stream;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ObservationManageAppServiceImpl implements IObservationManageAppService
|
public class ObservationManageAppServiceImpl implements IObservationManageAppService
|
||||||
{
|
{
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ObservationManageAppServiceImpl.class);
|
||||||
|
|
||||||
private final ObservationDefinitionMapper observationDefinitionMapper;
|
private final ObservationDefinitionMapper observationDefinitionMapper;
|
||||||
|
|
||||||
private final IObservationDefinitionService observationDefinitionService;
|
private final IObservationDefinitionService observationDefinitionService;
|
||||||
@@ -88,9 +92,23 @@ public class ObservationManageAppServiceImpl implements IObservationManageAppSer
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<?> updateOrAddObservationDef(ObservationDefinition Observation) {
|
public R<?> updateOrAddObservationDef(ObservationDefinition Observation) {
|
||||||
|
try {
|
||||||
Observation.setDeleteFlag(DelFlag.NO.getCode());
|
Observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||||
observationDefinitionService.saveOrUpdate(Observation);
|
boolean result = observationDefinitionService.saveOrUpdate(Observation);
|
||||||
return R.ok(" 添加成功");
|
if (result) {
|
||||||
|
log.info("保存检验项目成功:name={}, code={}, id={}",
|
||||||
|
Observation.getName(), Observation.getCode(), Observation.getId());
|
||||||
|
return R.ok("添加成功");
|
||||||
|
} else {
|
||||||
|
log.warn("保存检验项目失败:name={}, code={}",
|
||||||
|
Observation.getName(), Observation.getCode());
|
||||||
|
return R.fail("添加失败:保存操作未成功");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("保存检验项目异常:name={}, code={}, error={}",
|
||||||
|
Observation.getName(), Observation.getCode(), e.getMessage(), e);
|
||||||
|
return R.fail("添加失败:" + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.openhis.web.datadictionary.dto.*;
|
|||||||
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||||
import com.openhis.workflow.domain.ActivityDefinition;
|
import com.openhis.workflow.domain.ActivityDefinition;
|
||||||
import com.openhis.workflow.domain.ServiceRequest;
|
import com.openhis.workflow.domain.ServiceRequest;
|
||||||
|
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||||
import com.openhis.workflow.service.IServiceRequestService;
|
import com.openhis.workflow.service.IServiceRequestService;
|
||||||
import com.openhis.yb.service.YbManager;
|
import com.openhis.yb.service.YbManager;
|
||||||
@@ -63,6 +64,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private ActivityDefinitionMapper activityDefinitionMapper;
|
||||||
|
@Resource
|
||||||
private IItemDefinitionService itemDefinitionService;
|
private IItemDefinitionService itemDefinitionService;
|
||||||
@Resource
|
@Resource
|
||||||
private ISysDictTypeService sysDictTypeService;
|
private ISysDictTypeService sysDictTypeService;
|
||||||
@@ -235,6 +238,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
|||||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||||
|
|
||||||
|
// 显式设置新增的字段
|
||||||
|
activityDefinition.setSortOrder(diagnosisTreatmentUpDto.getSortOrder());
|
||||||
|
activityDefinition.setServiceRange(diagnosisTreatmentUpDto.getServiceRange());
|
||||||
|
|
||||||
// 拼音码
|
// 拼音码
|
||||||
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
||||||
// 五笔码
|
// 五笔码
|
||||||
@@ -252,12 +259,31 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询现有的价格定义
|
||||||
|
LambdaQueryWrapper<ChargeItemDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ChargeItemDefinition::getInstanceId, diagnosisTreatmentUpDto.getId())
|
||||||
|
.eq(ChargeItemDefinition::getInstanceTable, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
||||||
|
ChargeItemDefinition existingItem = chargeItemDefinitionService.getOne(queryWrapper);
|
||||||
|
|
||||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||||
chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType())
|
chargeItemDefinition.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
|
||||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
|
||||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
||||||
|
|
||||||
|
// 如果前端没有提交财务类别,则保留原有的值
|
||||||
|
if (StringUtils.isEmpty(diagnosisTreatmentUpDto.getItemTypeCode()) && existingItem != null) {
|
||||||
|
chargeItemDefinition.setTypeCode(existingItem.getTypeCode());
|
||||||
|
} else {
|
||||||
|
chargeItemDefinition.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果前端没有提交医保类别,则保留原有的值
|
||||||
|
if (StringUtils.isEmpty(diagnosisTreatmentUpDto.getYbType()) && existingItem != null) {
|
||||||
|
chargeItemDefinition.setYbType(existingItem.getYbType());
|
||||||
|
} else {
|
||||||
|
chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType());
|
||||||
|
}
|
||||||
|
|
||||||
// 插入操作记录
|
// 插入操作记录
|
||||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||||
@@ -267,9 +293,12 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
|||||||
// 更新子表,修改零售价,条件:单位
|
// 更新子表,修改零售价,条件:单位
|
||||||
boolean upItemDetail1 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
boolean upItemDetail1 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||||
// 更新子表,修改最高零售价,条件:限制
|
// 更新子表,修改最高零售价,条件:限制(只有当最高零售价不为null时才更新)
|
||||||
boolean upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
boolean upItemDetail2 = true;
|
||||||
|
if (diagnosisTreatmentUpDto.getMaximumRetailPrice() != null) {
|
||||||
|
upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
// 更新价格表
|
// 更新价格表
|
||||||
return upItemDef && upItemDetail1 && upItemDetail2
|
return upItemDef && upItemDetail1 && upItemDetail2
|
||||||
@@ -353,9 +382,16 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
|||||||
|
|
||||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||||
// 使用10位数基础采番
|
|
||||||
|
// 显式设置新增的字段
|
||||||
|
activityDefinition.setSortOrder(diagnosisTreatmentUpDto.getSortOrder());
|
||||||
|
activityDefinition.setServiceRange(diagnosisTreatmentUpDto.getServiceRange());
|
||||||
|
|
||||||
|
// 如果前端没有传入编码,则使用10位数基础采番
|
||||||
|
if (StringUtils.isEmpty(activityDefinition.getBusNo())) {
|
||||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10);
|
String code = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10);
|
||||||
activityDefinition.setBusNo(code);
|
activityDefinition.setBusNo(code);
|
||||||
|
}
|
||||||
// 拼音码
|
// 拼音码
|
||||||
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
||||||
// 五笔码
|
// 五笔码
|
||||||
@@ -363,6 +399,16 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
|||||||
|
|
||||||
// 新增外来诊疗目录
|
// 新增外来诊疗目录
|
||||||
activityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
activityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||||
|
|
||||||
|
// 检查编码是否已存在
|
||||||
|
List<ActivityDefinition> existingDefinitions = activityDefinitionMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<ActivityDefinition>()
|
||||||
|
.eq(ActivityDefinition::getBusNo, activityDefinition.getBusNo())
|
||||||
|
);
|
||||||
|
if (!existingDefinitions.isEmpty()) {
|
||||||
|
return R.fail(null, "诊疗编码已存在:" + activityDefinition.getBusNo());
|
||||||
|
}
|
||||||
|
|
||||||
if (activityDefinitionService.addDiagnosisTreatment(activityDefinition)) {
|
if (activityDefinitionService.addDiagnosisTreatment(activityDefinition)) {
|
||||||
// 调用医保目录对照接口
|
// 调用医保目录对照接口
|
||||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||||
|
|||||||
@@ -125,4 +125,9 @@ public class DiagnosisTreatmentDto {
|
|||||||
*/
|
*/
|
||||||
private String priceCode;
|
private String priceCode;
|
||||||
|
|
||||||
|
/** 序号 */
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/** 服务范围 */
|
||||||
|
private String serviceRange;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,4 +112,9 @@ public class DiagnosisTreatmentUpDto {
|
|||||||
*/
|
*/
|
||||||
private String priceCode;
|
private String priceCode;
|
||||||
|
|
||||||
|
/** 序号 */
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/** 服务范围 */
|
||||||
|
private String serviceRange;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto;
|
|||||||
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
|
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
|
||||||
import com.openhis.web.doctorstation.dto.ReceptionStatisticsDto;
|
import com.openhis.web.doctorstation.dto.ReceptionStatisticsDto;
|
||||||
import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper;
|
import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -33,8 +35,8 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 医生站-主页面 应用实现类
|
* 医生站-主页面 应用实现类
|
||||||
*/
|
*/
|
||||||
//@Slf4j
|
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService {
|
public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@@ -57,6 +59,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
IDoctorStationChineseMedicalAppService iDoctorStationChineseMedicalAppService;
|
IDoctorStationChineseMedicalAppService iDoctorStationChineseMedicalAppService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
/**
|
/**
|
||||||
* 查询就诊患者信息
|
* 查询就诊患者信息
|
||||||
*
|
*
|
||||||
@@ -97,9 +102,6 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
|
ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
|
||||||
currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
|
currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
|
||||||
EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
|
EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
|
||||||
//日志输出就诊患者信息,patientInfo
|
|
||||||
// log.debug("就诊患者信息: 总数={}, 记录数={}, 数据={}",
|
|
||||||
// patientInfo.getTotal(), patientInfo.getRecords().size(), patientInfo.getRecords());
|
|
||||||
patientInfo.getRecords().forEach(e -> {
|
patientInfo.getRecords().forEach(e -> {
|
||||||
// 性别
|
// 性别
|
||||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
@@ -163,11 +165,51 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> completeEncounter(Long encounterId) {
|
public R<?> completeEncounter(Long encounterId) {
|
||||||
|
// 1. 检查当前患者状态是否为就诊中(20)
|
||||||
|
Encounter encounter = encounterMapper.selectById(encounterId);
|
||||||
|
if (encounter == null) {
|
||||||
|
return R.fail("就诊记录不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查状态是否为就诊中
|
||||||
|
if (!EncounterStatus.IN_PROGRESS.getValue().equals(encounter.getStatusEnum())) {
|
||||||
|
return R.fail("当前患者不在就诊中状态");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 更新状态为已完成(30),并写入完成时间
|
||||||
|
Date now = new Date();
|
||||||
int update = encounterMapper.update(null,
|
int update = encounterMapper.update(null,
|
||||||
new LambdaUpdateWrapper<Encounter>().eq(Encounter::getId, encounterId)
|
new LambdaUpdateWrapper<Encounter>().eq(Encounter::getId, encounterId)
|
||||||
.set(Encounter::getStatusEnum, EncounterStatus.DISCHARGED.getValue())
|
.set(Encounter::getStatusEnum, EncounterStatus.DISCHARGED.getValue())
|
||||||
.set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.DEPARTED.getValue()));
|
.set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.DEPARTED.getValue())
|
||||||
return update > 0 ? R.ok() : R.fail();
|
.set(Encounter::getEndTime, now));
|
||||||
|
|
||||||
|
if (update <= 0) {
|
||||||
|
return R.fail("更新状态失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 写入审计日志
|
||||||
|
try {
|
||||||
|
String username = SecurityUtils.getUsernameSafe();
|
||||||
|
String sql = "INSERT INTO sys_oper_log "
|
||||||
|
+ "(title,oper_time,method,request_method,oper_name,oper_url,oper_param,json_result) "
|
||||||
|
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
|
||||||
|
|
||||||
|
jdbcTemplate.update(sql,
|
||||||
|
"完诊操作",
|
||||||
|
now,
|
||||||
|
"DoctorStationMainAppServiceImpl.completeEncounter()",
|
||||||
|
"POST",
|
||||||
|
username,
|
||||||
|
"/doctorstation/main/complete-encounter",
|
||||||
|
"{\"encounterId\": " + encounterId + "}",
|
||||||
|
"{\"code\": 200, \"msg\": \"就诊完成\", \"data\": null}");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("写入完诊审计日志失败", e);
|
||||||
|
// 审计日志失败不影响主流程
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok("就诊完成");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -64,8 +64,16 @@ public class DoctorStationMainController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/receive-encounter")
|
@GetMapping(value = "/receive-encounter")
|
||||||
public R<?> receiveEncounter(@RequestParam Long encounterId) {
|
public R<?> receiveEncounter(@RequestParam(value = "encounterId", required = false) String encounterId) {
|
||||||
return iDoctorStationMainAppService.receiveEncounter(encounterId);
|
if (encounterId == null || "undefined".equals(encounterId) || "null".equals(encounterId)) {
|
||||||
|
return R.fail("就诊ID不能为空");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Long id = Long.parseLong(encounterId);
|
||||||
|
return iDoctorStationMainAppService.receiveEncounter(id);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return R.fail("就诊ID格式错误");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,8 +83,16 @@ public class DoctorStationMainController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/leave-encounter")
|
@GetMapping(value = "/leave-encounter")
|
||||||
public R<?> leaveEncounter(@RequestParam Long encounterId) {
|
public R<?> leaveEncounter(@RequestParam(value = "encounterId", required = false) String encounterId) {
|
||||||
return iDoctorStationMainAppService.leaveEncounter(encounterId);
|
if (encounterId == null || "undefined".equals(encounterId) || "null".equals(encounterId)) {
|
||||||
|
return R.fail("就诊ID不能为空");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Long id = Long.parseLong(encounterId);
|
||||||
|
return iDoctorStationMainAppService.leaveEncounter(id);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return R.fail("就诊ID格式错误");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,8 +102,16 @@ public class DoctorStationMainController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/complete-encounter")
|
@GetMapping(value = "/complete-encounter")
|
||||||
public R<?> completeEncounter(@RequestParam Long encounterId) {
|
public R<?> completeEncounter(@RequestParam(value = "encounterId", required = false) String encounterId) {
|
||||||
return iDoctorStationMainAppService.completeEncounter(encounterId);
|
if (encounterId == null || "undefined".equals(encounterId) || "null".equals(encounterId)) {
|
||||||
|
return R.fail("就诊ID不能为空");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Long id = Long.parseLong(encounterId);
|
||||||
|
return iDoctorStationMainAppService.completeEncounter(id);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return R.fail("就诊ID格式错误");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,8 +121,16 @@ public class DoctorStationMainController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/cancel-encounter")
|
@GetMapping(value = "/cancel-encounter")
|
||||||
public R<?> cancelEncounter(@RequestParam Long encounterId) {
|
public R<?> cancelEncounter(@RequestParam(value = "encounterId", required = false) String encounterId) {
|
||||||
return iDoctorStationMainAppService.cancelEncounter(encounterId);
|
if (encounterId == null || "undefined".equals(encounterId) || "null".equals(encounterId)) {
|
||||||
|
return R.fail("就诊ID不能为空");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Long id = Long.parseLong(encounterId);
|
||||||
|
return iDoctorStationMainAppService.cancelEncounter(id);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return R.fail("就诊ID格式错误");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
T3.maximum_retail_price,
|
T3.maximum_retail_price,
|
||||||
T3.chrgitm_lv,
|
T3.chrgitm_lv,
|
||||||
T3.children_json,
|
T3.children_json,
|
||||||
T3.pricing_flag
|
T3.pricing_flag,
|
||||||
|
T3.sort_order,
|
||||||
|
T3.service_range
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@@ -61,7 +63,9 @@
|
|||||||
T2.price as retail_price,
|
T2.price as retail_price,
|
||||||
T4.amount as maximum_retail_price,
|
T4.amount as maximum_retail_price,
|
||||||
T1.children_json,
|
T1.children_json,
|
||||||
T1.pricing_flag
|
T1.pricing_flag,
|
||||||
|
T1.sort_order,
|
||||||
|
T1.service_range
|
||||||
FROM wor_activity_definition T1
|
FROM wor_activity_definition T1
|
||||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||||
LEFT JOIN adm_charge_item_definition T5 ON T5.instance_id = T1.id AND T5.instance_table = 'wor_activity_definition'
|
LEFT JOIN adm_charge_item_definition T5 ON T5.instance_id = T1.id AND T5.instance_table = 'wor_activity_definition'
|
||||||
@@ -120,7 +124,9 @@
|
|||||||
) as maximum_retail_price,
|
) as maximum_retail_price,
|
||||||
T1.chrgitm_lv,
|
T1.chrgitm_lv,
|
||||||
T1.children_json,
|
T1.children_json,
|
||||||
T1.pricing_flag
|
T1.pricing_flag,
|
||||||
|
T1.sort_order,
|
||||||
|
T1.service_range
|
||||||
FROM wor_activity_definition T1
|
FROM wor_activity_definition T1
|
||||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
@@ -73,4 +73,12 @@ public class OperatingRoom extends HisBaseEntity {
|
|||||||
public OperatingRoom() {
|
public OperatingRoom() {
|
||||||
this.statusEnum = LocationStatus.ACTIVE.getValue();
|
this.statusEnum = LocationStatus.ACTIVE.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getRoomTypeEnum() {
|
||||||
|
return roomTypeEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomTypeEnum(Integer roomTypeEnum) {
|
||||||
|
this.roomTypeEnum = roomTypeEnum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,4 +83,10 @@ public class ActivityDefinition extends HisBaseEntity {
|
|||||||
|
|
||||||
/** 划价标记 */
|
/** 划价标记 */
|
||||||
private Integer pricingFlag;
|
private Integer pricingFlag;
|
||||||
|
|
||||||
|
/** 序号 */
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/** 服务范围 */
|
||||||
|
private String serviceRange;
|
||||||
}
|
}
|
||||||
33
openhis-ui-vue3/src/api/system/lisConfig.js
Normal file
33
openhis-ui-vue3/src/api/system/lisConfig.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getLisConfigPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/lisConfig/init-page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLisConfigDetail(id) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/lisConfig/info-detail',
|
||||||
|
method: 'get',
|
||||||
|
params: { id }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLisConfigList(searchKey, type) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/lisConfig/init-list',
|
||||||
|
method: 'get',
|
||||||
|
params: { searchKey, type }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveLisConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/lisConfig/saveAll',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
48
openhis-ui-vue3/src/api/system/observation.js
Normal file
48
openhis-ui-vue3/src/api/system/observation.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getObservationInit() {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/observation/init',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getObservationPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/observation/information-page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getObservationOne(id) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/observation/information-one',
|
||||||
|
method: 'get',
|
||||||
|
params: { id }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addObservation(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/observation/information',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateObservation(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/observation/information',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteObservation(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/inspection/observation/information-status',
|
||||||
|
method: 'post',
|
||||||
|
data: { ids, type: '停用' }
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -696,6 +696,12 @@ import {
|
|||||||
listInspectionType,
|
listInspectionType,
|
||||||
updateInspectionType
|
updateInspectionType
|
||||||
} from '@/api/system/inspectionType';
|
} from '@/api/system/inspectionType';
|
||||||
|
import {
|
||||||
|
getDiagnosisTreatmentList,
|
||||||
|
addDiagnosisTreatment,
|
||||||
|
editDiagnosisTreatment,
|
||||||
|
stopDiseaseTreatment
|
||||||
|
} from '@/views/catalog/diagnosistreatment/components/diagnosistreatment';
|
||||||
import {listLisGroup} from '@/api/system/checkType';
|
import {listLisGroup} from '@/api/system/checkType';
|
||||||
import {
|
import {
|
||||||
addInspectionPackage,
|
addInspectionPackage,
|
||||||
@@ -703,7 +709,6 @@ import {
|
|||||||
listInspectionPackageDetails,
|
listInspectionPackageDetails,
|
||||||
saveInspectionPackageDetails
|
saveInspectionPackageDetails
|
||||||
} from '@/api/system/inspectionPackage';
|
} from '@/api/system/inspectionPackage';
|
||||||
import {getDiagnosisTreatmentList} from '@/views/catalog/diagnosistreatment/components/diagnosistreatment';
|
|
||||||
import {getLocationTree} from '@/views/charge/outpatientregistration/components/outpatientregistration';
|
import {getLocationTree} from '@/views/charge/outpatientregistration/components/outpatientregistration';
|
||||||
|
|
||||||
// 获取当前登录用户信息
|
// 获取当前登录用户信息
|
||||||
@@ -917,24 +922,48 @@ const testTypes = ref([
|
|||||||
{ value: '其他检验', label: '其他检验' }
|
{ value: '其他检验', label: '其他检验' }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 检验项目数据
|
// 检验项目数据 - 从后端API获取
|
||||||
const inspectionItems = ref([
|
const inspectionItems = ref([]);
|
||||||
{ id: 1, code: '0101', name: '血常规五分类', testType: '生化', package: '肝功能12项', sampleType: '血液', amount: 36.00, sortOrder: 1, serviceRange: '全部', sub医技Type: '', remark: '', status: true },
|
|
||||||
{ id: 2, code: '0102', name: '肝功能12项', testType: '生化', package: '肝功能12项', sampleType: '血液', amount: 120.00, sortOrder: 2, serviceRange: '全部', sub医技Type: '', remark: '', status: true },
|
// 从后端API获取检验项目数据
|
||||||
{ id: 3, code: '0201', name: '尿常规', testType: '常规检验', package: '', sampleType: '尿液', amount: 25.00, sortOrder: 3, serviceRange: '全部', sub医技Type: '', remark: '', status: true },
|
const loadObservationItems = async () => {
|
||||||
{ id: 4, code: '0202', name: '便常规+潜血', testType: '常规检验', package: '', sampleType: '粪便', amount: 30.00, sortOrder: 4, serviceRange: '门诊', sub医技Type: '', remark: '', status: true },
|
try {
|
||||||
{ id: 5, code: '0301', name: '乙肝五项', testType: '免疫学检验', package: '乙肝套餐', sampleType: '血液', amount: 75.00, sortOrder: 5, serviceRange: '全部', sub医技Type: '', remark: '', status: true },
|
const response = await getDiagnosisTreatmentList({
|
||||||
{ id: 6, code: '0302', name: '丙肝抗体', testType: '免疫学检验', package: '', sampleType: '血液', amount: 45.00, sortOrder: 6, serviceRange: '住院', sub医技Type: '', remark: '', status: true },
|
pageNo: 1,
|
||||||
{ id: 7, code: '0401', name: '血糖', testType: '生化', package: '糖尿病套餐', sampleType: '血液', amount: 15.00, sortOrder: 7, serviceRange: '全部', sub医技Type: '', remark: '', status: true },
|
pageSize: 100,
|
||||||
{ id: 8, code: '0402', name: '糖化血红蛋白', testType: '生化', package: '糖尿病套餐', sampleType: '血液', amount: 50.00, sortOrder: 8, serviceRange: '全部', sub医技Type: '', remark: '', status: true },
|
categoryCode: '检验'
|
||||||
{ id: 9, code: '0501', name: '肌酐', testType: '生化', package: '肾功能套餐', sampleType: '血液', amount: 25.00, sortOrder: 9, serviceRange: '住院', sub医技Type: '', remark: '', status: true },
|
});
|
||||||
{ id: 10, code: '0502', name: '尿素氮', testType: '生化', package: '肾功能套餐', sampleType: '血液', amount: 20.00, sortOrder: 10, serviceRange: '住院', sub医技Type: '', remark: '', status: true },
|
|
||||||
{ id: 11, code: '0601', name: '白带常规', testType: '常规检验', package: '', sampleType: '分泌物', amount: 30.00, sortOrder: 11, serviceRange: '门诊', sub医技Type: '', remark: '', status: true },
|
if (response.code === 200) {
|
||||||
{ id: 12, code: '0602', name: '前列腺液常规', testType: '常规检验', package: '', sampleType: '分泌物', amount: 35.00, sortOrder: 12, serviceRange: '门诊', sub医技Type: '', remark: '', status: true },
|
let data = [];
|
||||||
{ id: 13, code: '0701', name: '脑脊液常规', testType: '常规检验', package: '', sampleType: '脑脊液', amount: 60.00, sortOrder: 13, serviceRange: '住院', sub医技Type: '', remark: '', status: true },
|
if (response.data && response.data.records) {
|
||||||
{ id: 14, code: '0801', name: '肿瘤标志物CA125', testType: '免疫学检验', package: '肿瘤筛查套餐', sampleType: '血液', amount: 120.00, sortOrder: 14, serviceRange: '体检', sub医技Type: '', remark: '', status: true },
|
data = response.data.records;
|
||||||
{ id: 15, code: '0802', name: '肿瘤标志物AFP', testType: '免疫学检验', package: '肿瘤筛查套餐', sampleType: '血液', amount: 80.00, sortOrder: 15, serviceRange: '体检', sub医技Type: '', remark: '', status: true }
|
} else if (response.data && Array.isArray(response.data)) {
|
||||||
]);
|
data = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
inspectionItems.value = data
|
||||||
|
// 过滤掉已停用的项目(状态为3)
|
||||||
|
.filter(item => item.statusEnum !== 3)
|
||||||
|
.map(item => ({
|
||||||
|
id: item.id,
|
||||||
|
code: item.busNo || '',
|
||||||
|
name: item.name || '',
|
||||||
|
testType: '',
|
||||||
|
package: '',
|
||||||
|
sampleType: item.specimenCode_dictText || '',
|
||||||
|
amount: parseFloat(item.retailPrice || 0),
|
||||||
|
sortOrder: item.sortOrder || null,
|
||||||
|
serviceRange: item.serviceRange || '全部',
|
||||||
|
sub医技Type: '',
|
||||||
|
remark: item.descriptionText || '',
|
||||||
|
status: true
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取检验项目数据失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 过滤条件
|
// 过滤条件
|
||||||
const testTypeFilter = ref('');
|
const testTypeFilter = ref('');
|
||||||
@@ -1552,7 +1581,7 @@ const updateAmountFromPackage = (item) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveItem = (item) => {
|
const saveItem = async (item) => {
|
||||||
// 验证必填字段
|
// 验证必填字段
|
||||||
if (!item.code || item.code.trim() === '') {
|
if (!item.code || item.code.trim() === '') {
|
||||||
ElMessage.error('小类编码不能为空');
|
ElMessage.error('小类编码不能为空');
|
||||||
@@ -1594,24 +1623,67 @@ const saveItem = (item) => {
|
|||||||
// 从费用套餐获取金额
|
// 从费用套餐获取金额
|
||||||
updateAmountFromPackage(item);
|
updateAmountFromPackage(item);
|
||||||
|
|
||||||
// 保存成功
|
try {
|
||||||
|
// 准备提交给后端的数据
|
||||||
|
const submitData = {
|
||||||
|
busNo: item.code.trim(),
|
||||||
|
name: item.name.trim(),
|
||||||
|
categoryCode: '检验',
|
||||||
|
specimenCode: item.sampleType,
|
||||||
|
retailPrice: item.amount,
|
||||||
|
descriptionText: item.remark,
|
||||||
|
typeEnum: 1,
|
||||||
|
statusEnum: 2,
|
||||||
|
sortOrder: item.sortOrder ? parseInt(item.sortOrder) : null,
|
||||||
|
serviceRange: item.serviceRange || '全部'
|
||||||
|
};
|
||||||
|
|
||||||
|
// 判断是新增还是更新
|
||||||
|
if (typeof item.id === 'number') { // 临时ID(数字类型),新增
|
||||||
|
const response = await addDiagnosisTreatment(submitData);
|
||||||
|
if (response.code === 200) {
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
await loadObservationItems();
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.msg || '添加失败');
|
||||||
|
}
|
||||||
|
} else { // 真实ID(字符串类型),更新
|
||||||
|
submitData.id = item.id;
|
||||||
|
const response = await editDiagnosisTreatment(submitData);
|
||||||
|
if (response.code === 200) {
|
||||||
|
ElMessage.success('更新成功');
|
||||||
|
await loadObservationItems();
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.msg || '更新失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
editingRowId.value = null;
|
editingRowId.value = null;
|
||||||
ElMessage.success('保存成功');
|
} catch (error) {
|
||||||
|
console.error('保存检验项目失败:', error);
|
||||||
|
ElMessage.error('保存失败,请稍后重试');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteItem = (id) => {
|
const deleteItem = async (id) => {
|
||||||
ElMessageBox.confirm('确定要删除该检验项目吗?', '提示', {
|
ElMessageBox.confirm('确定要删除该检验项目吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(async () => {
|
||||||
const index = inspectionItems.value.findIndex(item => item.id === id);
|
try {
|
||||||
if (index !== -1) {
|
const response = await stopDiseaseTreatment([id]);
|
||||||
inspectionItems.value.splice(index, 1);
|
if (response.code === 200) {
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
|
await loadObservationItems();
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.msg || '删除失败');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('删除检验项目失败:', error);
|
||||||
|
ElMessage.error('删除失败,请稍后重试');
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 取消删除
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1993,6 +2065,8 @@ const refreshPage = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getInspectionTypeList();
|
getInspectionTypeList();
|
||||||
getLisGroupList();
|
getLisGroupList();
|
||||||
|
// 加载检验项目数据
|
||||||
|
loadObservationItems();
|
||||||
// 加载检验套餐明细项目
|
// 加载检验套餐明细项目
|
||||||
loadPackageItemsFromAPI();
|
loadPackageItemsFromAPI();
|
||||||
// 检查URL参数,如果有tab参数则切换到对应导航项
|
// 检查URL参数,如果有tab参数则切换到对应导航项
|
||||||
|
|||||||
Reference in New Issue
Block a user