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.mapper.ActivityDefinitionManageMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -45,6 +48,8 @@ import java.util.List;
|
||||
@Service
|
||||
public class LisConfigManageAppServiceImpl implements ILisConfigManageAppService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LisConfigManageAppServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||
@Resource
|
||||
@@ -120,31 +125,73 @@ public class LisConfigManageAppServiceImpl implements ILisConfigManageAppServic
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public R<?> saveAll(LisConfigManageDto manageDto) {
|
||||
//先全部删除项目下详情
|
||||
activityDefDeviceDefMapper.delete(new QueryWrapper<ActivityDefDeviceDef>().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()));
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// 根据ID查询【诊疗目录】详情
|
||||
DiagnosisTreatmentDto diseaseTreatmentOne = activityDefinitionManageMapper.getDiseaseTreatmentOne(manageDto.getId(), tenantId);
|
||||
manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
|
||||
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefDeviceDefMapper.insert(activityDefDeviceDef);
|
||||
});
|
||||
manageDto.getActivityDefObservationDefs().forEach(activityDefObservationDef -> {
|
||||
activityDefObservationDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefObservationDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefObservationDefMapper.insert(activityDefObservationDef);
|
||||
});
|
||||
manageDto.getActivityDefSpecimenDefs().forEach(activityDefSpecimenDef -> {
|
||||
activityDefSpecimenDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
||||
});
|
||||
|
||||
return R.ok();
|
||||
try {
|
||||
// 先全部删除项目下详情
|
||||
activityDefDeviceDefMapper.delete(new QueryWrapper<ActivityDefDeviceDef>().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()));
|
||||
|
||||
// 获取租户ID并验证
|
||||
Integer tenantId = null;
|
||||
try {
|
||||
tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
} catch (Exception e) {
|
||||
log.warn("获取租户ID失败,使用默认值", e);
|
||||
}
|
||||
|
||||
// 根据ID查询【诊疗目录】详情
|
||||
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 -> {
|
||||
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefDeviceDefMapper.insert(activityDefDeviceDef);
|
||||
});
|
||||
manageDto.getActivityDefObservationDefs().forEach(activityDefObservationDef -> {
|
||||
activityDefObservationDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefObservationDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefObservationDefMapper.insert(activityDefObservationDef);
|
||||
});
|
||||
manageDto.getActivityDefSpecimenDefs().forEach(activityDefSpecimenDef -> {
|
||||
activityDefSpecimenDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
||||
});
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -22,6 +22,8 @@ import com.openhis.web.Inspection.dto.ObservationDefManageDto;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefManageInitDto;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -42,6 +44,8 @@ import java.util.stream.Stream;
|
||||
@RequiredArgsConstructor
|
||||
public class ObservationManageAppServiceImpl implements IObservationManageAppService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(ObservationManageAppServiceImpl.class);
|
||||
|
||||
private final ObservationDefinitionMapper observationDefinitionMapper;
|
||||
|
||||
private final IObservationDefinitionService observationDefinitionService;
|
||||
@@ -88,9 +92,23 @@ public class ObservationManageAppServiceImpl implements IObservationManageAppSer
|
||||
|
||||
@Override
|
||||
public R<?> updateOrAddObservationDef(ObservationDefinition Observation) {
|
||||
Observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||
observationDefinitionService.saveOrUpdate(Observation);
|
||||
return R.ok(" 添加成功");
|
||||
try {
|
||||
Observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||
boolean result = observationDefinitionService.saveOrUpdate(Observation);
|
||||
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
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.openhis.web.datadictionary.dto.*;
|
||||
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
import com.openhis.yb.service.YbManager;
|
||||
@@ -63,6 +64,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
@Resource
|
||||
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||
@Resource
|
||||
private ActivityDefinitionMapper activityDefinitionMapper;
|
||||
@Resource
|
||||
private IItemDefinitionService itemDefinitionService;
|
||||
@Resource
|
||||
private ISysDictTypeService sysDictTypeService;
|
||||
@@ -234,7 +237,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||
|
||||
|
||||
// 显式设置新增的字段
|
||||
activityDefinition.setSortOrder(diagnosisTreatmentUpDto.getSortOrder());
|
||||
activityDefinition.setServiceRange(diagnosisTreatmentUpDto.getServiceRange());
|
||||
|
||||
// 拼音码
|
||||
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.setYbType(diagnosisTreatmentUpDto.getYbType())
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
chargeItemDefinition.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.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(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
@@ -267,9 +293,12 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail1 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制(只有当最高零售价不为null时才更新)
|
||||
boolean upItemDetail2 = true;
|
||||
if (diagnosisTreatmentUpDto.getMaximumRetailPrice() != null) {
|
||||
upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
}
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2
|
||||
@@ -353,9 +382,16 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||
// 使用10位数基础采番
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10);
|
||||
activityDefinition.setBusNo(code);
|
||||
|
||||
// 显式设置新增的字段
|
||||
activityDefinition.setSortOrder(diagnosisTreatmentUpDto.getSortOrder());
|
||||
activityDefinition.setServiceRange(diagnosisTreatmentUpDto.getServiceRange());
|
||||
|
||||
// 如果前端没有传入编码,则使用10位数基础采番
|
||||
if (StringUtils.isEmpty(activityDefinition.getBusNo())) {
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10);
|
||||
activityDefinition.setBusNo(code);
|
||||
}
|
||||
// 拼音码
|
||||
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
||||
// 五笔码
|
||||
@@ -363,6 +399,16 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
// 新增外来诊疗目录
|
||||
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)) {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
|
||||
@@ -125,4 +125,9 @@ public class DiagnosisTreatmentDto {
|
||||
*/
|
||||
private String priceCode;
|
||||
|
||||
/** 序号 */
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceRange;
|
||||
}
|
||||
|
||||
@@ -112,4 +112,9 @@ public class DiagnosisTreatmentUpDto {
|
||||
*/
|
||||
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.ReceptionStatisticsDto;
|
||||
import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
@@ -33,8 +35,8 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 医生站-主页面 应用实现类
|
||||
*/
|
||||
//@Slf4j
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService {
|
||||
|
||||
@Resource
|
||||
@@ -57,6 +59,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
|
||||
@Resource
|
||||
IDoctorStationChineseMedicalAppService iDoctorStationChineseMedicalAppService;
|
||||
|
||||
@Resource
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
/**
|
||||
* 查询就诊患者信息
|
||||
*
|
||||
@@ -97,9 +102,6 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
|
||||
currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
|
||||
EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
|
||||
//日志输出就诊患者信息,patientInfo
|
||||
// log.debug("就诊患者信息: 总数={}, 记录数={}, 数据={}",
|
||||
// patientInfo.getTotal(), patientInfo.getRecords().size(), patientInfo.getRecords());
|
||||
patientInfo.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
@@ -163,11 +165,51 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
*/
|
||||
@Override
|
||||
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,
|
||||
new LambdaUpdateWrapper<Encounter>().eq(Encounter::getId, encounterId)
|
||||
.set(Encounter::getStatusEnum, EncounterStatus.DISCHARGED.getValue())
|
||||
.set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.DEPARTED.getValue()));
|
||||
return update > 0 ? R.ok() : R.fail();
|
||||
.set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.DEPARTED.getValue())
|
||||
.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 结果
|
||||
*/
|
||||
@GetMapping(value = "/receive-encounter")
|
||||
public R<?> receiveEncounter(@RequestParam Long encounterId) {
|
||||
return iDoctorStationMainAppService.receiveEncounter(encounterId);
|
||||
public R<?> receiveEncounter(@RequestParam(value = "encounterId", required = false) String 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 结果
|
||||
*/
|
||||
@GetMapping(value = "/leave-encounter")
|
||||
public R<?> leaveEncounter(@RequestParam Long encounterId) {
|
||||
return iDoctorStationMainAppService.leaveEncounter(encounterId);
|
||||
public R<?> leaveEncounter(@RequestParam(value = "encounterId", required = false) String 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 结果
|
||||
*/
|
||||
@GetMapping(value = "/complete-encounter")
|
||||
public R<?> completeEncounter(@RequestParam Long encounterId) {
|
||||
return iDoctorStationMainAppService.completeEncounter(encounterId);
|
||||
public R<?> completeEncounter(@RequestParam(value = "encounterId", required = false) String 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 结果
|
||||
*/
|
||||
@GetMapping(value = "/cancel-encounter")
|
||||
public R<?> cancelEncounter(@RequestParam Long encounterId) {
|
||||
return iDoctorStationMainAppService.cancelEncounter(encounterId);
|
||||
public R<?> cancelEncounter(@RequestParam(value = "encounterId", required = false) String 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.chrgitm_lv,
|
||||
T3.children_json,
|
||||
T3.pricing_flag
|
||||
T3.pricing_flag,
|
||||
T3.sort_order,
|
||||
T3.service_range
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@@ -61,7 +63,9 @@
|
||||
T2.price as retail_price,
|
||||
T4.amount as maximum_retail_price,
|
||||
T1.children_json,
|
||||
T1.pricing_flag
|
||||
T1.pricing_flag,
|
||||
T1.sort_order,
|
||||
T1.service_range
|
||||
FROM wor_activity_definition T1
|
||||
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'
|
||||
@@ -120,7 +124,9 @@
|
||||
) as maximum_retail_price,
|
||||
T1.chrgitm_lv,
|
||||
T1.children_json,
|
||||
T1.pricing_flag
|
||||
T1.pricing_flag,
|
||||
T1.sort_order,
|
||||
T1.service_range
|
||||
FROM wor_activity_definition T1
|
||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||
<where>
|
||||
|
||||
@@ -73,4 +73,12 @@ public class OperatingRoom extends HisBaseEntity {
|
||||
public OperatingRoom() {
|
||||
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 sortOrder;
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceRange;
|
||||
}
|
||||
Reference in New Issue
Block a user