专病路径类型

This commit is contained in:
zhangheng 2024-07-03 17:18:44 +08:00
parent 1d6b088320
commit b7e377c9c3

View File

@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.PatientSexEnum; import com.xinelu.common.enums.PatientSexEnum;
import com.xinelu.common.enums.ReleaseStatusEnum; import com.xinelu.common.enums.ReleaseStatusEnum;
import com.xinelu.common.enums.TemplateTypeEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.BaseUtil; import com.xinelu.common.utils.BaseUtil;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
@ -55,8 +54,8 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper; private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper;
@Resource @Resource
private PatientInfoMapper patientInfoMapper; private PatientInfoMapper patientInfoMapper;
@Resource @Resource
private IPatientAllInfoViewService patientAllInfoViewService; private IPatientAllInfoViewService patientAllInfoViewService;
/** /**
@ -123,16 +122,16 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
if (Objects.nonNull(specialDiseaseNode) && Objects.nonNull(specialDiseaseNode.getSpecialDiseaseRouteId())) { if (Objects.nonNull(specialDiseaseNode) && Objects.nonNull(specialDiseaseNode.getSpecialDiseaseRouteId())) {
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseNode.getSpecialDiseaseRouteId()); SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseNode.getSpecialDiseaseRouteId());
if (specialDiseaseRoute.getParentRouteId() == null || specialDiseaseRoute.getParentRouteId() == 0) { if (specialDiseaseRoute.getParentRouteId() == null || specialDiseaseRoute.getParentRouteId() == 0) {
if (Objects.nonNull(specialDiseaseRoute) && StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) { if (Objects.nonNull(specialDiseaseRoute) && StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
return AjaxResult.error("已发布过的专病路径不能修改!"); return AjaxResult.error("已发布过的专病路径不能修改!");
} }
} else { } else {
// 判断主路径的发布状态 // 判断主路径的发布状态
SpecialDiseaseRoute parentRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseRoute.getParentRouteId()); SpecialDiseaseRoute parentRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseRoute.getParentRouteId());
if (Objects.nonNull(parentRoute) && StringUtils.isNotBlank(parentRoute.getReleaseStatus()) && !StringUtils.equals(ReleaseStatusEnum.UNPUBLISHED.getInfo(), specialDiseaseRoute.getReleaseStatus())) { if (Objects.nonNull(parentRoute) && StringUtils.isNotBlank(parentRoute.getReleaseStatus()) && !StringUtils.equals(ReleaseStatusEnum.UNPUBLISHED.getInfo(), specialDiseaseRoute.getReleaseStatus())) {
return AjaxResult.error("已发布过的专病路径不能修改!"); return AjaxResult.error("已发布过的专病路径不能修改!");
} }
} }
} }
List<Long> longs = specialDiseaseNodeMapper.selectSpecialDiseaseRouteIds(specialDiseaseNode.getSpecialDiseaseRouteId()); List<Long> longs = specialDiseaseNodeMapper.selectSpecialDiseaseRouteIds(specialDiseaseNode.getSpecialDiseaseRouteId());
SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute(); SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute();
@ -156,20 +155,18 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
List<SpecialDiseaseNodeVO> specialDiseaseNodeVOS = new ArrayList<>(); List<SpecialDiseaseNodeVO> specialDiseaseNodeVOS = new ArrayList<>();
int i = 0; int i = 0;
for (SpecialDiseaseNodeVO diseaseNode : specialDiseaseNode.getSpecialDiseaseNodeList()) { for (SpecialDiseaseNodeVO diseaseNode : specialDiseaseNode.getSpecialDiseaseNodeList()) {
if(StringUtils.isBlank(diseaseNode.getRouteNodeName())) { if (StringUtils.isBlank(diseaseNode.getRouteNodeName())) {
throw new ServiceException("请输入节点名称"); throw new ServiceException("请输入节点名称");
} }
if (diseaseNode.getRouteNodeDay() == null) { if (diseaseNode.getRouteNodeDay() == null) {
throw new ServiceException("请输入节点时间"); throw new ServiceException("请输入节点时间");
} }
if (StringUtils.isBlank(diseaseNode.getTaskType()) || StringUtils.isBlank(diseaseNode.getTaskSubdivision()) || StringUtils.isBlank(diseaseNode.getTaskStatus())) { if (StringUtils.isBlank(diseaseNode.getTaskType()) || StringUtils.isBlank(diseaseNode.getTaskSubdivision()) || StringUtils.isBlank(diseaseNode.getTaskStatus())) {
throw new ServiceException("任务类型、任务细分、任务状态不能为空"); throw new ServiceException("任务类型、任务细分、任务状态不能为空");
} }
diseaseNode.setRouteId(specialDiseaseRoute.getId()); diseaseNode.setRouteId(specialDiseaseRoute.getId());
diseaseNode.setRouteName(specialDiseaseNode.getRouteName()); diseaseNode.setRouteName(specialDiseaseNode.getRouteName());
diseaseNode.setTemplateType(null); if (Objects.isNull(diseaseNode.getPhonePushSign()) || diseaseNode.getPhonePushSign() == 0) {
if (StringUtils.isNotBlank(diseaseNode.getTaskSubdivisiontemplateType())
&& (TemplateTypeEnum.QUESTIONNAIRE.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()) || TemplateTypeEnum.PROPAGANDA.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()) || TemplateTypeEnum.SCRIPT.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()))) {
diseaseNode.setTemplateType(diseaseNode.getTaskSubdivisiontemplateType()); diseaseNode.setTemplateType(diseaseNode.getTaskSubdivisiontemplateType());
} }
diseaseNode.setUpdateTime(LocalDateTime.now()); diseaseNode.setUpdateTime(LocalDateTime.now());
@ -281,26 +278,27 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
return retList; return retList;
} }
@Override public List<RouteTaskAuditVo> getByParentRouteId(Long parentRouteId) { @Override
return specialDiseaseNodeMapper.getByParentRouteId(parentRouteId); public List<RouteTaskAuditVo> getByParentRouteId(Long parentRouteId) {
} return specialDiseaseNodeMapper.getByParentRouteId(parentRouteId);
}
/** /**
* 根据任务细分类型获取患者的真实信息 * 根据任务细分类型获取患者的真实信息
* *
* @param patientId 患者主键 * @param patientId 患者主键
* @return 实际信息 * @return 实际信息
*/ */
private JSONObject getParamsValue(Long patientId) { private JSONObject getParamsValue(Long patientId) {
JSONObject retObj = new JSONObject(); JSONObject retObj = new JSONObject();
PatientAllInfoView patientAllInfoView = patientAllInfoViewService.selectPatientAllInfoViewByPatientId(patientId); PatientAllInfoView patientAllInfoView = patientAllInfoViewService.selectPatientAllInfoViewByPatientId(patientId);
if (ObjectUtils.isEmpty(patientAllInfoView)) { if (ObjectUtils.isEmpty(patientAllInfoView)) {
throw new ServiceException("患者信息获取错误,请联系管理员!"); throw new ServiceException("患者信息获取错误,请联系管理员!");
} }
retObj = JSONObject.parseObject(JSONObject.toJSONString(patientAllInfoView)); retObj = JSONObject.parseObject(JSONObject.toJSONString(patientAllInfoView));
// 性别转换成中文计算年龄 // 性别转换成中文计算年龄
retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientAllInfoView.getSex()).getInfo()) retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientAllInfoView.getSex()).getInfo())
.fluentPut("age", BaseUtil.getAge(patientAllInfoView.getBirthDate())); .fluentPut("age", BaseUtil.getAge(patientAllInfoView.getBirthDate()));
return retObj; return retObj;
} }
} }