任务审核接口。

This commit is contained in:
haown 2024-06-27 09:38:02 +08:00
parent c8bf7350a3
commit 1a6c71f192
19 changed files with 740 additions and 140 deletions

View File

@ -13,37 +13,52 @@ public enum RouteNodeNameEnum {
/** /**
* 出院后 * 出院后
*/ */
AFTER_DISCHARGE("AFTER_DISCHARGE"), AFTER_DISCHARGE("AFTER_DISCHARGE", "出院后"),
/** /**
* 入院后 * 入院后
*/ */
AFTER_ADMISSION("AFTER_ADMISSION"), AFTER_ADMISSION("AFTER_ADMISSION", "入院后"),
/** /**
* 就诊后 * 就诊后
*/ */
AFTER_CONSULTATION("AFTER_CONSULTATION"), AFTER_CONSULTATION("AFTER_CONSULTATION", "就诊后"),
/** /**
* 就诊/出院后 * 就诊/出院后
*/ */
AFTER_VISIT_DISCHARGE("AFTER_VISIT_DISCHARGE"), AFTER_VISIT_DISCHARGE("AFTER_VISIT_DISCHARGE", "就诊/出院后"),
/** /**
* 术前 * 术前
*/ */
PREOPERATIVE("PREOPERATIVE"), PREOPERATIVE("PREOPERATIVE", "术前"),
/** /**
* 术后 * 术后
*/ */
POSTOPERATIVE("POSTOPERATIVE"), POSTOPERATIVE("POSTOPERATIVE", "术后"),
; ;
final private String info; final private String info;
final private String name;
RouteNodeNameEnum(String info) { RouteNodeNameEnum(String info, String name) {
this.info = info; this.info = info;
this.name = name;
} }
public String getName() {
return name;
}
public static RouteNodeNameEnum getNameByInfo(String info) {
for (RouteNodeNameEnum routeNodeName : RouteNodeNameEnum.values()) {
if (info.equals(routeNodeName.getInfo())) {
return routeNodeName;
}
}
return RouteNodeNameEnum.AFTER_VISIT_DISCHARGE;
}
} }

View File

@ -113,4 +113,5 @@ public class PatientInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(patientInfoService.deletePatientInfoByIds(ids)); return toAjax(patientInfoService.deletePatientInfoByIds(ids));
} }
} }

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.controller.signpatientmanageroute;
import com.xinelu.common.annotation.Log; import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.custominterface.Insert; import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.enums.BusinessType; import com.xinelu.common.enums.BusinessType;
@ -16,6 +17,7 @@ import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -139,9 +141,10 @@ public class SignPatientManageRouteController extends BaseController {
* @param signRecordId 患者签约主键 * @param signRecordId 患者签约主键
* @return 主路径信息及节点子路径信息及节点 * @return 主路径信息及节点子路径信息及节点
*/ */
@ApiOperation("路径审核->路径信息")
@GetMapping("/getRouteAuditInfo/{signRecordId}") @GetMapping("/getRouteAuditInfo/{signRecordId}")
public SpecialDiseaseRouteAuditVo getRouteAuditInfo(@PathVariable("signRecordId") Long signRecordId){ public R<SpecialDiseaseRouteAuditVo> getRouteAuditInfo(@PathVariable("signRecordId") Long signRecordId){
return signPatientManageRouteService.getRouteAuditInfo(signRecordId); return R.ok(signPatientManageRouteService.getRouteAuditInfo(signRecordId));
} }
/** /**
@ -149,8 +152,10 @@ public class SignPatientManageRouteController extends BaseController {
* @param signRecordId 患者签约主键 * @param signRecordId 患者签约主键
* @return 节点详细信息 * @return 节点详细信息
*/ */
@ApiOperation("路径审核->路径任务")
@GetMapping("/getRouteNodeInfo/{signRecordId}") @GetMapping("/getRouteNodeInfo/{signRecordId}")
public List<SignPatientManageNodeAuditVo> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) { public R<List<SignPatientManageNodeAuditVo>> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) {
return signPatientManageRouteService.getRouteNodeInfo(signRecordId); return R.ok(signPatientManageRouteService.getRouteNodeInfo(signRecordId));
} }
} }

View File

@ -4,6 +4,7 @@ import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R; import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.dto.signpatientrecord.IntentionalSignDto; import com.xinelu.manage.dto.signpatientrecord.IntentionalSignDto;
import com.xinelu.manage.dto.signpatientrecord.RouteCheckDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientAddDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientAddDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto;
@ -103,4 +104,33 @@ public class SignPatientRecordController extends BaseController {
int flag = signPatientRecordService.updateSignStatus(updateSignStatus); int flag = signPatientRecordService.updateSignStatus(updateSignStatus);
return flag < 0 ? R.fail() : R.ok(); return flag < 0 ? R.fail() : R.ok();
} }
/**
* 路径审核->左侧画像信息列表
*/
@ApiOperation("路径审核->左侧画像信息列表")
@GetMapping("/getPortaitInfo/{patientId}")
public R<SignPatientInfoVo> getPortaitInfo(@PathVariable("patientId") Long patientId) {
signPatientRecordService.getPortaitInfo(patientId);
return R.ok();
}
/**
* 画像审核
*/
@ApiOperation("画像审核")
@PostMapping("/updatePortaitCheckStatus")
public R<String> updatePortaitCheckStatus(@RequestBody RouteCheckDto checkDto) {
int flag = signPatientRecordService.updatePortaitCheckStatus(checkDto);
return flag < 0 ? R.fail() : R.ok();
}
/**
* 路径审核
*/
@ApiOperation("路径审核")
@PostMapping("/updateRouteCheckStatus")
public R<String> updateRouteCheckStatus(@RequestBody RouteCheckDto routeCheckDto) {
int flag = signPatientRecordService.updateRouteCheckStatus(routeCheckDto);
return flag < 0 ? R.fail() : R.ok();
}
} }

View File

@ -227,6 +227,24 @@ public class SignPatientRecord extends BaseEntity {
@ApiModelProperty(value = "健康管理师姓名") @ApiModelProperty(value = "健康管理师姓名")
private String healthManageName; private String healthManageName;
/**
* 画像审核状态同意AGREE不同意DISAGREE
*/
@ApiModelProperty(value = "画像审核状态同意AGREE不同意DISAGREE")
private String portaitCheckStatus;
/**
* 画像审核人姓名
*/
@ApiModelProperty(value = "画像审核人姓名")
private String portaitCheckPerson;
/**
* 画像审核时间
*/
@ApiModelProperty(value = "画像审核时间")
private LocalDateTime portaitCheckDate;
/** /**
* 专病路径审核状态同意AGREE不同意DISAGREE * 专病路径审核状态同意AGREE不同意DISAGREE
*/ */

View File

@ -0,0 +1,28 @@
package com.xinelu.manage.dto.signpatientrecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 路径审核传世对象
* @author: haown
* @create: 2024-06-26 13:41
**/
@Data
public class RouteCheckDto {
@ApiModelProperty("签约记录主键")
private Long signPatientRecordId;
/**
* 专病路径审核状态同意AGREE不同意DISAGREE
*/
@ApiModelProperty(value = "专病路径审核状态同意AGREE不同意DISAGREE")
private String routeCheckStatus;
/**
* 专病路径审核备注信息存储审核备注信息以及审核不通过原因等信息
*/
@ApiModelProperty(value = "专病路径审核备注信息,存储审核备注信息以及审核不通过原因等信息")
private String routeCheckRemark;
}

View File

@ -103,9 +103,15 @@ public interface SignPatientManageRouteNodeMapper {
/** /**
* 任务审核查询手动创建的任务节点详情 * 任务审核查询手动创建的任务节点详情
* @param manageIds 路径主键列表 * @param manageRouteIds 路径主键列表
* @return 节点详细信息列表 * @return 节点详细信息列表
*/ */
List<SignPatientManageNodeAuditVo> selectAuditNodeInfo(List<Long> manageIds); List<SignPatientManageNodeAuditVo> selectAuditNodeInfo(@Param("manageRouteIds") List<Long> manageRouteIds);
/**
* 根据路径主键列表查询节点列表
* @param manageRouteIds 路径主键列表
* @return 节点列表
*/
List<SignPatientManageRouteNode> selectNodesByManageIds(@Param("manageRouteIds") List<Long> manageRouteIds);
} }

View File

@ -104,4 +104,5 @@ public interface ISignPatientManageRouteService {
* @return 节点详细信息列表 * @return 节点详细信息列表
*/ */
List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId); List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId);
} }

View File

@ -8,6 +8,7 @@ import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.NodeExecuteStatusEnum;
import com.xinelu.common.enums.PhoneConnectStatusEnum; import com.xinelu.common.enums.PhoneConnectStatusEnum;
import com.xinelu.common.enums.PhoneMessageRemindEnum; import com.xinelu.common.enums.PhoneMessageRemindEnum;
import com.xinelu.common.enums.RouteNodeNameEnum;
import com.xinelu.common.enums.TaskContentEnum; import com.xinelu.common.enums.TaskContentEnum;
import com.xinelu.common.enums.TaskCreateTypeEnum; import com.xinelu.common.enums.TaskCreateTypeEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
@ -157,7 +158,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) {
//新增主表 // 新增主表
signPatientManageRoute.setTaskCreateType(TaskCreateTypeEnum.MANUAL_CREATE.getInfo()); signPatientManageRoute.setTaskCreateType(TaskCreateTypeEnum.MANUAL_CREATE.getInfo());
signPatientManageRoute.setCreateBy(SecurityUtils.getUsername()); signPatientManageRoute.setCreateBy(SecurityUtils.getUsername());
signPatientManageRoute.setCreateTime(LocalDateTime.now()); signPatientManageRoute.setCreateTime(LocalDateTime.now());
@ -165,7 +166,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
if (insertRoute < 0) { if (insertRoute < 0) {
return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!"); return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!");
} }
//新增节点表 // 新增节点表
List<SignPatientManageRouteNode> signPatientManageRouteNodes = new ArrayList<>(); List<SignPatientManageRouteNode> signPatientManageRouteNodes = new ArrayList<>();
for (SignPatientManageRouteNode routeNode : signPatientManageRoute.getRouteNodeList()) { for (SignPatientManageRouteNode routeNode : signPatientManageRoute.getRouteNodeList()) {
if (Objects.isNull(routeNode) || StringUtils.isBlank(routeNode.getTaskType()) || (" ").equals(routeNode.getTaskType()) || StringUtils.isBlank(routeNode.getRouteNodeName()) || Objects.isNull(routeNode.getRouteNodeDay())) { if (Objects.isNull(routeNode) || StringUtils.isBlank(routeNode.getTaskType()) || (" ").equals(routeNode.getTaskType()) || StringUtils.isBlank(routeNode.getRouteNodeName()) || Objects.isNull(routeNode.getRouteNodeDay())) {
@ -400,6 +401,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
} }
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
SpecialDiseaseRouteAuditVo specialDiseaseRouteAuditVo = specialDiseaseRouteService.getRouteAuditInfo(signPatientManageRoute.getRouteId()); SpecialDiseaseRouteAuditVo specialDiseaseRouteAuditVo = specialDiseaseRouteService.getRouteAuditInfo(signPatientManageRoute.getRouteId());
if (ObjectUtils.isEmpty(specialDiseaseRouteAuditVo)) {
throw new ServiceException("未找到该专病管理路径请联系管理员");
}
// 计算子路径的节点执行时间 // 计算子路径的节点执行时间
PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId()); PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId());
if (ObjectUtils.isEmpty(patientVisitRecord)) { if (ObjectUtils.isEmpty(patientVisitRecord)) {
@ -435,6 +439,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
}); });
} }
specialDiseaseRouteAuditVo.setRouteCheckStatus(signPatientRecord.getRouteCheckStatus());
return specialDiseaseRouteAuditVo; return specialDiseaseRouteAuditVo;
} }
@ -457,6 +462,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
List<RouteTaskAuditVo> nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId()); List<RouteTaskAuditVo> nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId());
// 查询患者画像信息 // 查询患者画像信息
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId()); List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId());
if (CollectionUtils.isEmpty(labelFieldContentList)) {
throw new ServiceException("请先维护画像信息");
}
// 组装数据 // 组装数据
nodeList.forEach(node -> { nodeList.forEach(node -> {
SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo(); SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo();
@ -465,51 +473,54 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
manageRouteNode.setId(null); manageRouteNode.setId(null);
manageRouteNode.setRouteNodeId(node.getId()); manageRouteNode.setRouteNodeId(node.getId());
manageRouteNode.setExecuteTime(node.getExecutionTime()); manageRouteNode.setExecuteTime(node.getExecutionTime());
manageRouteNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
JSONObject templateDetail = new JSONObject(); JSONObject templateDetail = new JSONObject();
// 根据模板类型存放模板字段 // 根据模板类型存放模板字段
switch(node.getTemplateType()) { if(StringUtils.isNotBlank(node.getTemplateType())) {
// 宣教 switch(node.getTemplateType()) {
case TemplateTypeConstants.PROPAGANDA: // 宣教
manageRouteNode.setPropagandaInfoId(node.getTemplateId()); case TemplateTypeConstants.PROPAGANDA:
manageRouteNode.setPropagandaTitle(node.getTemplateName()); manageRouteNode.setPropagandaInfoId(node.getTemplateId());
// 查询宣教表 manageRouteNode.setPropagandaTitle(node.getTemplateName());
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId()); // 查询宣教表
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId());
manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
manageRouteNode.setTemplateDetail(templateDetail); manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
break;
// 问卷
case TemplateTypeConstants.QUESTIONNAIRE:
manageRouteNode.setQuestionInfoId(node.getTemplateId());
manageRouteNode.setQuestionnaireName(node.getTemplateName());
// 查询问卷详情
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId());
if (ObjectUtils.isNotEmpty(questionVO)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
manageRouteNode.setTemplateDetail(templateDetail); manageRouteNode.setTemplateDetail(templateDetail);
} break;
break; // 问卷
// 话术 case TemplateTypeConstants.QUESTIONNAIRE:
case TemplateTypeConstants.SCRIPT: manageRouteNode.setQuestionInfoId(node.getTemplateId());
manageRouteNode.setPhoneId(node.getTemplateId()); manageRouteNode.setQuestionnaireName(node.getTemplateName());
// 查询话术 // 查询问卷详情
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getTemplateId()); QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId());
if (ObjectUtils.isNotEmpty(scriptInfo)) { if (ObjectUtils.isNotEmpty(questionVO)) {
// 话术库json内容替换 templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
manageRouteNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); manageRouteNode.setTemplateDetail(templateDetail);
manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT);
manageRouteNode.setTemplateDetail(templateDetail);
// 电话短信内容
if (node.getPhoneMessageTemplateId() != null) {
// 查询短信库
manageRouteNode.setPhoneMessageTemplateContent(replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList));
} }
} break;
break; // 话术
case TemplateTypeConstants.SCRIPT:
manageRouteNode.setPhoneId(node.getTemplateId());
// 查询话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getTemplateId());
if (ObjectUtils.isNotEmpty(scriptInfo)) {
// 话术库json内容替换
manageRouteNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT);
manageRouteNode.setTemplateDetail(templateDetail);
// 电话短信内容
if (node.getPhoneMessageTemplateId() != null) {
// 查询短信库
manageRouteNode.setPhoneMessageTemplateContent(replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList));
}
}
break;
}
} }
// 替换短信公众号小程序内容 // 替换短信公众号小程序内容
replaceTemplateInfo(manageRouteNode, node, labelFieldContentList); replaceTemplateInfo(manageRouteNode, node, labelFieldContentList);
@ -520,72 +531,77 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
} else { } else {
manageNodeList.add(manageRouteNode); manageNodeList.add(manageRouteNode);
} }
manageNodeAuditList.addAll(manageNodeList); manageNodeAuditList.addAll(manageNodeList);
}); });
// 查询手动创建的节点 // 查询手动创建的节点
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
List<SignPatientManageRoute> createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); List<SignPatientManageRoute> createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
List<Long> manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(createRouteList)) {
List<SignPatientManageNodeAuditVo> manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds); List<Long> manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList());
// 根据node去替换模板信息 List<SignPatientManageNodeAuditVo> manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds);
manageNodeList.forEach(manageNode -> { // 根据node去替换模板信息
JSONObject templateDetail = new JSONObject(); manageNodeList.forEach(manageNode -> {
switch(manageNode.getTaskType()) { manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName());
// 电话外呼--话术 JSONObject templateDetail = new JSONObject();
case TaskContentConstants.PHONE_OUTBOUND: switch(manageNode.getTaskType()) {
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId()); // 电话外呼--话术
if (ObjectUtils.isNotEmpty(scriptInfo)) { case TaskContentConstants.PHONE_OUTBOUND:
// 话术库json内容替换 ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId());
manageNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); if (ObjectUtils.isNotEmpty(scriptInfo)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); // 话术库json内容替换
manageNode.setTemplateType(TemplateTypeConstants.SCRIPT); manageNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
manageNode.setTemplateDetail(templateDetail); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
manageNode.setTemplateType(TemplateTypeConstants.SCRIPT);
manageNode.setTemplateDetail(templateDetail);
// 电话短信内容 // 电话短信内容
if (manageNode.getPhoneMessageTemplateId() != null) { if (manageNode.getPhoneMessageTemplateId() != null) {
// 查询短信库 // 查询短信库
manageNode.setPhoneMessageTemplateContent(replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); manageNode.setPhoneMessageTemplateContent(replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList));
}
} }
} break;
break;
// 问卷 // 问卷
case TaskContentConstants.QUESTIONNAIRE_SCALE: case TaskContentConstants.QUESTIONNAIRE_SCALE:
// 查询问卷详情 // 查询问卷详情
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
if (ObjectUtils.isNotEmpty(questionVO)) { if (ObjectUtils.isNotEmpty(questionVO)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateDetail(templateDetail);
} }
break; break;
// 宣教 // 宣教
case TaskContentConstants.PROPAGANDA_ARTICLE: case TaskContentConstants.PROPAGANDA_ARTICLE:
// 查询宣教详情 // 查询宣教详情
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId()); PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId());
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateDetail(templateDetail);
} }
break; break;
// 文字提醒 // 文字提醒
//case TaskContentConstants.TEXT_REMIND: case TaskContentConstants.TEXT_REMIND:
// manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); manageNode.setTemplateType(TaskContentConstants.TEXT_REMIND);
// break; break;
// 人工随访 // 人工随访
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP: case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
// 查询问卷详情 // 查询问卷详情
QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(Long.valueOf(manageNode.getPhoneTemplateId())); if (StringUtils.isNotBlank(manageNode.getPhoneTemplateId())) {
if (ObjectUtils.isNotEmpty(questionVO1)) { QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(Long.valueOf(manageNode.getPhoneTemplateId()));
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1)); if (ObjectUtils.isNotEmpty(questionVO1)) {
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
} manageNode.setTemplateDetail(templateDetail);
break; }
} }
manageNodeAuditList.add(manageNode); break;
}); }
manageNodeAuditList.add(manageNode);
});
}
return manageNodeAuditList; return manageNodeAuditList;
} }
@ -630,7 +646,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
/** /**
* 塞值 * 塞值
*/ */
private static void extracted(SignPatientManageRouteVO signPatientManageRoute, List<SignPatientManageRouteNode> signPatientManageRouteNodes, SignPatientManageRouteNode routeNode) { private void extracted(SignPatientManageRouteVO signPatientManageRoute, List<SignPatientManageRouteNode> signPatientManageRouteNodes, SignPatientManageRouteNode routeNode) {
SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode(); SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode();
if (Objects.nonNull(routeNode) && TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(routeNode.getTaskType())) { if (Objects.nonNull(routeNode) && TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setPhonePushSign(Objects.isNull(routeNode.getPhonePushSign()) ? null : routeNode.getPhonePushSign()); signPatientManageRouteNode.setPhonePushSign(Objects.isNull(routeNode.getPhonePushSign()) ? null : routeNode.getPhonePushSign());
@ -643,7 +659,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
signPatientManageRouteNode.setPhoneMessageRemind(StringUtils.isBlank(routeNode.getPhoneMessageRemind()) ? null : routeNode.getPhoneMessageRemind()); signPatientManageRouteNode.setPhoneMessageRemind(StringUtils.isBlank(routeNode.getPhoneMessageRemind()) ? null : routeNode.getPhoneMessageRemind());
signPatientManageRouteNode.setPhoneMessageTemplateId(Objects.isNull(routeNode.getPhoneMessageTemplateId()) ? null : routeNode.getPhoneMessageTemplateId()); signPatientManageRouteNode.setPhoneMessageTemplateId(Objects.isNull(routeNode.getPhoneMessageTemplateId()) ? null : routeNode.getPhoneMessageTemplateId());
signPatientManageRouteNode.setPhoneMessageTemplateName(StringUtils.isBlank(routeNode.getPhoneMessageTemplateName()) ? null : routeNode.getPhoneMessageTemplateName()); signPatientManageRouteNode.setPhoneMessageTemplateName(StringUtils.isBlank(routeNode.getPhoneMessageTemplateName()) ? null : routeNode.getPhoneMessageTemplateName());
} }
if (Objects.nonNull(routeNode) && TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(routeNode.getTaskType())) { if (Objects.nonNull(routeNode) && TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setQuestionInfoId(Objects.isNull(routeNode.getQuestionInfoId()) ? null : routeNode.getQuestionInfoId()); signPatientManageRouteNode.setQuestionInfoId(Objects.isNull(routeNode.getQuestionInfoId()) ? null : routeNode.getQuestionInfoId());
signPatientManageRouteNode.setQuestionnaireName(StringUtils.isBlank(routeNode.getQuestionnaireName()) ? null : routeNode.getQuestionnaireName()); signPatientManageRouteNode.setQuestionnaireName(StringUtils.isBlank(routeNode.getQuestionnaireName()) ? null : routeNode.getQuestionnaireName());
@ -730,16 +746,16 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
} }
private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) { private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) {
if (node.getMessagePushSign() == 1) { if (node.getMessagePushSign() != null && node.getMessagePushSign() == 1) {
// 替换短信模板 // 替换短信模板
manageRouteNode.setMessageNodeContent(replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList)); manageRouteNode.setMessageNodeContent(replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList));
} }
// 替换公众号模板 // 替换公众号模板
if (node.getOfficialPushSign() == 1) { if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) {
manageRouteNode.setOfficialNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList)); manageRouteNode.setOfficialNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
} }
// 替换小程序模板 // 替换小程序模板
if (node.getAppletPushSign() == 1) { if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) {
manageRouteNode.setAppletNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList)); manageRouteNode.setAppletNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
} }
} }
@ -779,25 +795,30 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
Map<Long, List<LabelFieldInfoContentVo>> groupbyPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId)); Map<Long, List<LabelFieldInfoContentVo>> groupbyPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
List<LabelFieldInfoContentVo> nodeParamList = groupbyPartition.get(node.getTaskPartitionDictId()); List<LabelFieldInfoContentVo> nodeParamList = groupbyPartition.get(node.getTaskPartitionDictId());
// 参数按照序列号分组 // 参数按照序列号分组
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeParamList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn)); if (CollectionUtils.isNotEmpty(nodeParamList)) {
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeParamList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
for (String portraitSn : groupBySn.keySet()) { for (String portraitSn : groupBySn.keySet()) {
SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo(); SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo();
BeanUtils.copyBeanProp(manageNode, manageRouteNode); BeanUtils.copyBeanProp(manageNode, manageRouteNode);
// 替换文本 // 替换文本
List<LabelFieldInfoContentVo> nodeParams = groupBySn.get(portraitSn); List<LabelFieldInfoContentVo> nodeParams = groupBySn.get(portraitSn);
Map<String, String> map = nodeParams.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo::getFieldValue,(key1,key2)->key2)); Map<String, String> map = nodeParams.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo::getFieldValue,(key1,key2)->key2));
Document document = Jsoup.parse(manageNode.getNodeContent()); Document document = Jsoup.parse(manageNode.getNodeContent());
// 需要提取的span // 需要提取的span
Elements spanlist = document.select("span[data-w-e-type]"); Elements spanlist = document.select("span[data-w-e-type]");
for (Element span : spanlist) { for (Element span : spanlist) {
String paramKey = span.attr("data-fieldMark"); String paramKey = span.attr("data-fieldMark");
span.text(map.getOrDefault(paramKey, "")); span.text(map.getOrDefault(paramKey, ""));
span.unwrap(); span.unwrap();
}
manageNode.setNodeContent(document.body().html());
manageNodeList.add(manageNode);
} }
manageNode.setNodeContent(document.body().html()); } else {
manageNodeList.add(manageNode); throw new ServiceException("请维护该患者【"+node.getTaskPartitionDictName()+ "】的画像信息");
} }
return manageNodeList; return manageNodeList;
} }
} }

View File

@ -140,4 +140,16 @@ public interface ISignPatientManageRouteNodeService {
void generateTask(Long manageRouteNodeId, String taskType); void generateTask(Long manageRouteNodeId, String taskType);
LocalDateTime getExecuteTime(LocalTime executeTime, String routeNodeName, Integer routeNodeDay, PatientVisitRecord patientVisitRecord); LocalDateTime getExecuteTime(LocalTime executeTime, String routeNodeName, Integer routeNodeDay, PatientVisitRecord patientVisitRecord);
/**
* 画像审核通过/路径审核通过后生成主路径任务
* @param signRecordId 签约记录主键
*/
void generateMainRouteTask(Long signRecordId);
/**
* 手动创建的任务标签替换
* @param signRecordId 签约记录主键
*/
void manualCreateTaskLabelReplace(Long signRecordId);
} }

View File

@ -24,11 +24,13 @@ import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
import com.xinelu.manage.domain.specialdiseasetriggercondition.SpecialDiseaseTriggerCondition; import com.xinelu.manage.domain.specialdiseasetriggercondition.SpecialDiseaseTriggerCondition;
import com.xinelu.manage.domain.textmessage.TextMessage; import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto; import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto; import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper; import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
@ -38,10 +40,12 @@ import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper; import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
import com.xinelu.manage.mapper.textmessage.TextMessageMapper; import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService; import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
import com.xinelu.manage.service.questioninfo.IQuestionInfoService; import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService; import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo; import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
import com.xinelu.manage.vo.questionInfo.QuestionVO; import com.xinelu.manage.vo.questionInfo.QuestionVO;
import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo;
@ -59,6 +63,9 @@ import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -102,6 +109,10 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
private TextMessageMapper textMessageMapper; private TextMessageMapper textMessageMapper;
@Resource @Resource
private SpecialDiseaseTriggerConditionMapper triggerConditionMapper; private SpecialDiseaseTriggerConditionMapper triggerConditionMapper;
@Resource
private LabelFieldContentMapper labelFieldContentMapper;
@Resource
private WechatTemplateMapper wechatTemplateMapper;
/** /**
* 查询签约患者管理任务路径节点 * 查询签约患者管理任务路径节点
@ -584,6 +595,132 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return executeDateTime; return executeDateTime;
} }
@Override public void generateMainRouteTask(Long signRecordId) {
List<SignPatientManageRouteNode> nodeSaveList = new ArrayList<>();
// 查询专病路径节点和手动创建的任务节点
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
if (ObjectUtils.isEmpty(signPatientRecord)) {
throw new ServiceException("未找到该患者签约信息");
}
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
manageRouteQuery.setSignPatientRecordId(signRecordId);
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
List<SignPatientManageRoute> manageRouteList = signRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
if (CollectionUtils.isEmpty(manageRouteList)) {
throw new ServiceException("未找到签约管理路径");
}
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
// 查询路径节点
SpecialDiseaseNode specialDiseaseNodeQuery = new SpecialDiseaseNode();
specialDiseaseNodeQuery.setRouteId(signPatientManageRoute.getRouteId());
List<SpecialDiseaseNode> nodeList = specialDiseaseNodeMapper.selectSpecialDiseaseNodeList(specialDiseaseNodeQuery);
// 查询患者画像信息
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId());
if (CollectionUtils.isEmpty(labelFieldContentList)) {
throw new ServiceException("请先维护画像信息");
}
// 组装数据
nodeList.forEach(node -> {
SignPatientManageRouteNode manageRouteNode = new SignPatientManageRouteNode();
BeanUtils.copyBeanProp(manageRouteNode, node);
manageRouteNode.setManageRouteId(signPatientManageRoute.getId());
manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
manageRouteNode.setId(null);
manageRouteNode.setRouteNodeId(node.getId());
manageRouteNode.setExecuteTime(node.getExecutionTime());
// 根据模板类型存放模板字段
if(StringUtils.isNotBlank(node.getTemplateType())) {
switch(node.getTemplateType()) {
// 宣教
case TemplateTypeConstants.PROPAGANDA:
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
manageRouteNode.setPropagandaTitle(node.getTemplateName());
break;
// 问卷
case TemplateTypeConstants.QUESTIONNAIRE:
manageRouteNode.setQuestionInfoId(node.getTemplateId());
manageRouteNode.setQuestionnaireName(node.getTemplateName());
break;
// 话术
case TemplateTypeConstants.SCRIPT:
manageRouteNode.setPhoneId(node.getTemplateId());
// 查询话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getTemplateId());
if (ObjectUtils.isNotEmpty(scriptInfo)) {
// 话术库json内容替换
manageRouteNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
// 电话短信内容
if (node.getPhoneMessageTemplateId() != null) {
// 查询短信库
manageRouteNode.setPhoneMessageTemplateContent(replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList));
}
}
break;
}
}
// 替换短信公众号小程序内容
replaceTemplateInfo(manageRouteNode, node, labelFieldContentList);
// 替换nodeContent
List<SignPatientManageRouteNode> manageNodeList = new ArrayList<>();
if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) {
manageNodeList = replaceNodeContent(manageRouteNode, node, labelFieldContentList);
} else {
manageNodeList.add(manageRouteNode);
}
nodeSaveList.addAll(manageNodeList);
// 保存
signPatientManageRouteNodeMapper.insertBatch(nodeSaveList);
});
}
@Override
public void manualCreateTaskLabelReplace(Long signRecordId) {
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
manageRouteQuery.setSignPatientRecordId(signRecordId);
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
List<SignPatientManageRoute> manageRouteList = signRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
if (CollectionUtils.isNotEmpty(manageRouteList)) {
// 查询患者画像信息
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(manageRouteList.get(0).getPatientId());
if (CollectionUtils.isEmpty(labelFieldContentList)) {
throw new ServiceException("请先维护画像信息");
}
List<Long> manageRouteIds = manageRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList());
List<SignPatientManageRouteNode> manageNodeList = signPatientManageRouteNodeMapper.selectNodesByManageIds(manageRouteIds);
// 根据node去替换模板信息
manageNodeList.forEach(manageNode -> {
switch(manageNode.getTaskType()) {
// 电话外呼--话术
case TaskContentConstants.PHONE_OUTBOUND:
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId());
if (ObjectUtils.isNotEmpty(scriptInfo)) {
// 话术库json内容替换
manageNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
// 电话短信内容
if (manageNode.getPhoneMessageTemplateId() != null) {
// 查询短信库
manageNode.setPhoneMessageTemplateContent(replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList));
}
}
break;
// 问卷
case TaskContentConstants.QUESTIONNAIRE_SCALE:
// 宣教
case TaskContentConstants.PROPAGANDA_ARTICLE:
// 文字提醒
case TaskContentConstants.TEXT_REMIND:
// 人工随访
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
break;
}
signPatientManageRouteNodeMapper.updateSignPatientManageRouteNode(manageNode);
});
}
}
/** /**
* 生成子路径任务 * 生成子路径任务
* @param patientId 患者主键 * @param patientId 患者主键
@ -611,4 +748,130 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return document.body().html(); return document.body().html();
} }
/**
* 话术json参数替换
* @param flowScheme 话术json
* @param labelFieldContentList 患者画像信息
* @return
*/
private String getFlowScheme(String flowScheme, List<LabelFieldInfoContentVo> labelFieldContentList) {
// 话术库json内容替换
if (org.apache.commons.lang3.StringUtils.isNotBlank(flowScheme) && org.apache.commons.lang3.StringUtils.contains(flowScheme, "{{") && org.apache.commons.lang3.StringUtils.contains(flowScheme, "}}")) {
// 替换{{}}中的内容
Pattern pattern = Pattern.compile("\\{\\{([^\\{\\}}]+)\\}\\}");
Matcher matcher = pattern.matcher(flowScheme);
while (matcher.find()) {
//过滤出符合条件的对象不匹配返回null
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null);
if (ObjectUtils.isNotEmpty(labelFieldContent)) {
flowScheme = flowScheme.replaceAll("\\{\\{([^\\{\\}}]+)\\}\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
}
}
}
return flowScheme;
}
/**
* * 短信模板内容
* @param messageTemplateId 短信模板主键
* @param labelFieldContentList 患者画像信息
* @return
*/
private String replaceMessageInfo(Long messageTemplateId, List<LabelFieldInfoContentVo> labelFieldContentList) {
// 查询短信模板
TextMessage textMessage = textMessageMapper.selectTextMessageById(messageTemplateId);
String textMessageContent = textMessage.getTextMessageContent();
// 替换{{}}中的内容
Pattern pattern = Pattern.compile("\\{\\{([^\\{\\}}]+)\\}\\}");
Matcher matcher = pattern.matcher(textMessage.getTextMessageContent());
while (matcher.find()) {
// 过滤出符合条件的对象不匹配返回null
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null);
if (ObjectUtils.isNotEmpty(labelFieldContent)) {
textMessageContent = textMessageContent.replaceAll("\\{\\{([^\\{\\}}]+)\\}\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
}
}
return textMessageContent;
}
/**
* 替换短信公众号小程序内容
* @param manageRouteNode 签约路径节点
* @param node
* @param labelFieldContentList
*/
private void replaceTemplateInfo(SignPatientManageRouteNode manageRouteNode, SpecialDiseaseNode node, List<LabelFieldInfoContentVo> labelFieldContentList) {
if (node.getMessagePushSign() != null && node.getMessagePushSign() == 1) {
// 替换短信模板
manageRouteNode.setMessageNodeContent(replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList));
}
// 替换公众号模板
if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) {
manageRouteNode.setOfficialNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
}
// 替换小程序模板
if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) {
manageRouteNode.setAppletNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
}
}
/**
* 替换公众号小程序模板内容
* @param templateId 微信库模板id
* @param labelFieldContentList 患者画像信息
*/
private String replaceWeChatTemplate(Long templateId, List<LabelFieldInfoContentVo> labelFieldContentList) {
WechatTemplate wechatTemplate = wechatTemplateMapper.selectWechatTemplateById(templateId);
if (ObjectUtils.isEmpty(wechatTemplate)){
return null;
}
String templateContent = wechatTemplate.getTemplateContent();
Pattern pattern = Pattern.compile("\\{\\{([^\\{\\}}]+)\\}\\}");
Matcher matcher = pattern.matcher(templateContent);
while (matcher.find()) {
// 过滤出符合条件的对象不匹配返回null
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null);
if (ObjectUtils.isNotEmpty(labelFieldContent)) {
templateContent = templateContent.replaceAll("\\{\\{([^\\{\\}}]+)\\}\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
}
}
return templateContent;
}
/**
* 替换节点内容
* @param node 节点
* @param labelFieldContentList 画像信息
* @return 替换标签后的节点列表
*/
private List<SignPatientManageRouteNode> replaceNodeContent(SignPatientManageRouteNode manageRouteNode, SpecialDiseaseNode node, List<LabelFieldInfoContentVo> labelFieldContentList) {
List<SignPatientManageRouteNode> manageNodeList = new ArrayList<>();
// 按照任务细分分组
Map<Long, List<LabelFieldInfoContentVo>> groupbyPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
List<LabelFieldInfoContentVo> nodeParamList = groupbyPartition.get(node.getTaskSubdivision());
// 参数按照序列号分组
if (CollectionUtils.isNotEmpty(nodeParamList)) {
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeParamList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
for (String portraitSn : groupBySn.keySet()) {
SignPatientManageRouteNode manageNode = new SignPatientManageRouteNode();
BeanUtils.copyBeanProp(manageNode, manageRouteNode);
// 替换文本
List<LabelFieldInfoContentVo> nodeParams = groupBySn.get(portraitSn);
Map<String, String> map = nodeParams.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo::getFieldValue,(key1,key2)->key2));
Document document = Jsoup.parse(manageNode.getNodeContent());
// 需要提取的span
Elements spanlist = document.select("span[data-w-e-type]");
for (Element span : spanlist) {
String paramKey = span.attr("data-fieldMark");
span.text(map.getOrDefault(paramKey, ""));
span.unwrap();
}
manageNode.setNodeContent(document.body().html());
manageNodeList.add(manageNode);
}
}
return manageNodeList;
}
} }

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.signpatientrecord; package com.xinelu.manage.service.signpatientrecord;
import com.xinelu.manage.dto.signpatientrecord.IntentionalSignDto; import com.xinelu.manage.dto.signpatientrecord.IntentionalSignDto;
import com.xinelu.manage.dto.signpatientrecord.RouteCheckDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientAddDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientAddDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto;
@ -46,4 +47,19 @@ public interface ISignPatientRecordService {
* @return * @return
*/ */
int intentionalSign(IntentionalSignDto intentionalSignDto); int intentionalSign(IntentionalSignDto intentionalSignDto);
void getPortaitInfo(Long patientId);
/**
* 画像审核
* @param checkDto 画像审核传输对象
* @return
*/
int updatePortaitCheckStatus(RouteCheckDto checkDto);
/**
* 路径审核
* @param routeCheckDto 路径审核传输对象
* @return
*/
int updateRouteCheckStatus(RouteCheckDto routeCheckDto);
} }

View File

@ -1,9 +1,11 @@
package com.xinelu.manage.service.signpatientrecord.impl; package com.xinelu.manage.service.signpatientrecord.impl;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.annotation.DataScope; import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.SignRecordServiceStatusConstants; import com.xinelu.common.constant.SignRecordServiceStatusConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.TaskCreateTypeConstant;
import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.NodeExecuteStatusEnum;
import com.xinelu.common.enums.RouteCheckStatusEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.StringUtils;
@ -20,9 +22,11 @@ import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto; import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
import com.xinelu.manage.dto.signpatientpackage.SignPatientPackageSaveDto; import com.xinelu.manage.dto.signpatientpackage.SignPatientPackageSaveDto;
import com.xinelu.manage.dto.signpatientrecord.IntentionalSignDto; import com.xinelu.manage.dto.signpatientrecord.IntentionalSignDto;
import com.xinelu.manage.dto.signpatientrecord.RouteCheckDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientAddDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientAddDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto;
import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientnodeparamslog.PatientNodeParamsLogMapper; import com.xinelu.manage.mapper.patientnodeparamslog.PatientNodeParamsLogMapper;
import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper; import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper;
@ -35,13 +39,17 @@ import com.xinelu.manage.mapper.signroutetriggercondition.SignRouteTriggerCondit
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper; import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper; import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService; import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
import com.xinelu.manage.vo.patientinfo.PatientPortaitVo;
import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo;
import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo;
import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
@ -85,6 +93,10 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper; private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper;
@Resource @Resource
private PatientNodeParamsLogMapper patientNodeParamsLogMapper; private PatientNodeParamsLogMapper patientNodeParamsLogMapper;
@Resource
private ISignPatientManageRouteNodeService signPatientManageRouteNodeService;
@Resource
private LabelFieldContentMapper labelFieldContentMapper;
@Override @Override
@DataScope(agencyAlias = "sign") @DataScope(agencyAlias = "sign")
@ -301,4 +313,93 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
} }
return flag; return flag;
} }
/**
* 任务审核页面左侧画像信息
* @param patientId 患者主键
*/
@Override
public void getPortaitInfo(Long patientId) {
// 查询患者诊断信息手术信息
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId);
if (ObjectUtils.isEmpty(patientInfo)) {
throw new ServiceException("数据有误,未找到该患者");
}
List<JSONObject> drugInfo = new ArrayList<>();
List<JSONObject> consultationInfo = new ArrayList<>();
// 查询画像信息
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(patientId);
if (!CollectionUtils.isEmpty(labelFieldContentList)) {
// 按照任务细分分组
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
// 查询用药
List<LabelFieldInfoContentVo> drugList = labelFieldContentList.stream().filter(labelField->labelField.getFieldCode().equals("DRUGNAME")).collect(Collectors.toList());
// 包含用药的标签列表
List<LabelFieldInfoContentVo> drugLabelList = new ArrayList<>();
for (LabelFieldInfoContentVo drugName : drugList) {
drugLabelList.addAll(groupByPartition.get(drugName.getTaskPartitionDictId()));
}
// 按照sn分组每个分组是一个用药
if (!CollectionUtils.isEmpty(drugLabelList)) {
Map<String, List<LabelFieldInfoContentVo>> patientDrugList = drugLabelList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
for (String sn : patientDrugList.keySet()) {
List<LabelFieldInfoContentVo> propertyList = patientDrugList.get(sn);
JSONObject drug = new JSONObject();
propertyList.forEach(property-> {
drug.fluentPut(property.getFieldCode(), property.getFieldValue());
});
drugInfo.add(drug);
}
}
// 查询复诊日期
List<LabelFieldInfoContentVo> consultationList = labelFieldContentList.stream().filter(labelField->labelField.getFieldCode().equals("CONSULTATIONDATE")).collect(Collectors.toList());
// 包含复诊的标签列表
List<LabelFieldInfoContentVo> consultationLabelList = new ArrayList<>();
for (LabelFieldInfoContentVo consultation : consultationList) {
consultationLabelList.addAll(groupByPartition.get(consultation.getTaskPartitionDictId()));
}
// 按照sn分组每个分组是一个复诊
if (!CollectionUtils.isEmpty(consultationLabelList)) {
Map<String, List<LabelFieldInfoContentVo>> patientConsultationList = drugLabelList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
for (String sn : patientConsultationList.keySet()) {
List<LabelFieldInfoContentVo> propertyList = patientConsultationList.get(sn);
JSONObject consultation = new JSONObject();
propertyList.forEach(property-> {
consultation.fluentPut(property.getFieldCode(), property.getFieldValue());
});
consultationInfo.add(consultation);
}
}
}
PatientPortaitVo.builder().mainDiagnosis(patientInfo.getMainDiagnosis())
.surgicalName(patientInfo.getSurgicalName()).drugInfo(drugInfo).consultationInfo(consultationInfo).build();
}
@Override public int updatePortaitCheckStatus(RouteCheckDto checkDto) {
return 0;
}
@Override
@Transactional
public int updateRouteCheckStatus(RouteCheckDto routeCheckDto) {
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(routeCheckDto.getSignPatientRecordId());
if (ObjectUtils.isEmpty(signPatientRecord)) {
throw new ServiceException("未找到该签约记录");
}
signPatientRecord.setRouteCheckStatus(routeCheckDto.getRouteCheckStatus());
signPatientRecord.setRouteCheckRemark(routeCheckDto.getRouteCheckRemark());
signPatientRecord.setRouteCheckDate(LocalDateTime.now());
signPatientRecord.setRouteCheckPerson(SecurityUtils.getLoginUser().getUser().getNickName());
int flag = signPatientRecordMapper.updateByPrimaryKeySelective(signPatientRecord);
if (StringUtils.equals(RouteCheckStatusEnum.AGREE.getInfo(), signPatientRecord.getRouteCheckStatus()) && StringUtils.equals(RouteCheckStatusEnum.AGREE.getInfo(), signPatientRecord.getPortaitCheckStatus())) {
// 路径画像都审核通过则生成主路径任务
signPatientManageRouteNodeService.generateMainRouteTask(routeCheckDto.getSignPatientRecordId());
// 替换手动生成的任务中的标签
signPatientManageRouteNodeService.manualCreateTaskLabelReplace(routeCheckDto.getSignPatientRecordId());
}
return flag;
}
} }

View File

@ -0,0 +1,35 @@
package com.xinelu.manage.vo.patientinfo;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: 患者画像信息视图类
* @author: haown
* @create: 2024-06-26 17:30
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PatientPortaitVo {
/**
* 主要诊断
*/
@ApiModelProperty(value = "主要诊断")
private String mainDiagnosis;
@ApiModelProperty(value = "手术名称")
private String surgicalName;
@ApiModelProperty(value = "用药信息")
private List<JSONObject> drugInfo;
@ApiModelProperty("复诊信息")
private List<JSONObject> consultationInfo;
}

View File

@ -43,4 +43,10 @@ public class SignPatientManageNodeAuditVo extends SignPatientManageRouteNode {
@ApiModelProperty(value = "推送方式") @ApiModelProperty(value = "推送方式")
private String pushMethod; private String pushMethod;
/**
* 节点名称-中文
*/
@ApiModelProperty(value = "节点名称-中文")
private String routeNodeNameCN;
} }

View File

@ -186,6 +186,12 @@ public class SignPatientListVo {
@ApiModelProperty(value = "专病路径审核状态同意AGREE不同意DISAGREE") @ApiModelProperty(value = "专病路径审核状态同意AGREE不同意DISAGREE")
private String routeCheckStatus; private String routeCheckStatus;
/**
* 画像审核状态同意AGREE不同意DISAGREE
*/
@ApiModelProperty(value = "画像审核状态同意AGREE不同意DISAGREE")
private String portaitCheckStatus;
/** 服务包表id */ /** 服务包表id */
@ApiModelProperty(value = "服务包表id") @ApiModelProperty(value = "服务包表id")
@Excel(name = "服务包表id") @Excel(name = "服务包表id")

View File

@ -31,6 +31,9 @@ public class SpecialDiseaseRouteAuditVo {
@ApiModelProperty(value = "病种名称") @ApiModelProperty(value = "病种名称")
private String diseaseTypeName; private String diseaseTypeName;
@ApiModelProperty("路径审核状态")
private String routeCheckStatus;
/** /**
* 主路径节点列表 * 主路径节点列表
*/ */

View File

@ -781,14 +781,23 @@
<select id="selectAuditNodeInfo" resultType="com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo"> <select id="selectAuditNodeInfo" resultType="com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo">
select select
sdn.*, node.*,
dic.dict_label as taskTypeName dic.dict_label as taskTypeName
from sign_patient_manage_route_node node from sign_patient_manage_route_node node
left join sys_dict_data dic on sdn.task_type = dic.dict_value left join sys_dict_data dic on node.task_type = dic.dict_value
where sdn.manage_route_id in where node.manage_route_id in
<foreach item="manageRouteId" collection="array" open="(" separator="," close=")"> <foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
#{manageRouteId} #{manageRouteId}
</foreach> </foreach>
and dic.dict_type ='task_content' and dic.dict_type ='task_content'
</select> </select>
<select id="selectNodesByManageIds" resultMap="SignPatientManageRouteNodeResult">
<include refid="selectSignPatientManageRouteNodeVo"/>
where manage_route_id in
<foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
#{manageRouteId}
</foreach>
and dic.dict_type ='task_content'
</select>
</mapper> </mapper>

View File

@ -37,6 +37,9 @@
<result property="paymentStatus" column="payment_status" jdbcType="VARCHAR"/> <result property="paymentStatus" column="payment_status" jdbcType="VARCHAR"/>
<result property="healthManageId" column="health_manage_id" jdbcType="VARCHAR"/> <result property="healthManageId" column="health_manage_id" jdbcType="VARCHAR"/>
<result property="healthManageName" column="health_manage_name" jdbcType="VARCHAR"/> <result property="healthManageName" column="health_manage_name" jdbcType="VARCHAR"/>
<result property="portaitCheckStatus" column="portait_check_status" jdbcType="VARCHAR"/>
<result property="portaitCheckPerson" column="portait_check_person" jdbcType="VARCHAR"/>
<result property="portaitCheckDate" column="portait_check_date" jdbcType="TIMESTAMP"/>
<result property="routeCheckStatus" column="route_check_status" jdbcType="VARCHAR"/> <result property="routeCheckStatus" column="route_check_status" jdbcType="VARCHAR"/>
<result property="routeCheckPerson" column="route_check_person" jdbcType="VARCHAR"/> <result property="routeCheckPerson" column="route_check_person" jdbcType="VARCHAR"/>
<result property="routeCheckDate" column="route_check_date" jdbcType="TIMESTAMP"/> <result property="routeCheckDate" column="route_check_date" jdbcType="TIMESTAMP"/>
@ -58,6 +61,7 @@
service_status,sign_status,intentional_source, service_status,sign_status,intentional_source,
intentional_time,billing_doctor_id,billing_doctor_name, intentional_time,billing_doctor_id,billing_doctor_name,
price,payment_status,health_manage_id,health_manage_name, price,payment_status,health_manage_id,health_manage_name,
portait_check_status,portait_check_person,portait_check_date,
route_check_status,route_check_person,route_check_date,route_check_remark, route_check_status,route_check_person,route_check_date,route_check_remark,
del_flag,create_by,create_time,update_by,update_time del_flag,create_by,create_time,update_by,update_time
</sql> </sql>
@ -84,6 +88,7 @@
,service_status,sign_status,intentional_source ,service_status,sign_status,intentional_source
,intentional_time,billing_doctor_id,billing_doctor_name ,intentional_time,billing_doctor_id,billing_doctor_name
,price,payment_status,health_manage_id,health_manage_name ,price,payment_status,health_manage_id,health_manage_name
,portait_check_status,portait_check_person,portait_check_date
,route_check_status,route_check_person,route_check_date,route_check_remark ,route_check_status,route_check_person,route_check_date,route_check_remark
,del_flag,create_by,create_time,update_by ,del_flag,create_by,create_time,update_by
,update_time) ,update_time)
@ -96,6 +101,7 @@
,#{serviceStatus,jdbcType=VARCHAR},#{signStatus,jdbcType=VARCHAR},#{intentionalSource,jdbcType=VARCHAR} ,#{serviceStatus,jdbcType=VARCHAR},#{signStatus,jdbcType=VARCHAR},#{intentionalSource,jdbcType=VARCHAR}
,#{intentionalTime,jdbcType=TIMESTAMP},#{billingDoctorId,jdbcType=BIGINT},#{billingDoctorName,jdbcType=VARCHAR} ,#{intentionalTime,jdbcType=TIMESTAMP},#{billingDoctorId,jdbcType=BIGINT},#{billingDoctorName,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL},#{paymentStatus,jdbcType=VARCHAR},#{healthManageId,jdbcType=BIGINT},#{healthManageName,jdbcType=VARCHAR} ,#{price,jdbcType=DECIMAL},#{paymentStatus,jdbcType=VARCHAR},#{healthManageId,jdbcType=BIGINT},#{healthManageName,jdbcType=VARCHAR}
,#{portaitCheckStatus,jdbcType=VARCHAR},#{portaitCheckPerson,jdbcType=VARCHAR},#{portaitCheckDate,jdbcType=TIMESTAMP}
,#{routeCheckStatus,jdbcType=VARCHAR},#{routeCheckPerson,jdbcType=VARCHAR},#{routeCheckDate,jdbcType=TIMESTAMP},#{routeCheckRemark,jdbcType=VARCHAR} ,#{routeCheckStatus,jdbcType=VARCHAR},#{routeCheckPerson,jdbcType=VARCHAR},#{routeCheckDate,jdbcType=TIMESTAMP},#{routeCheckRemark,jdbcType=VARCHAR}
,#{delFlag,jdbcType=TINYINT},#{createBy,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateBy,jdbcType=VARCHAR} ,#{delFlag,jdbcType=TINYINT},#{createBy,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateBy,jdbcType=VARCHAR}
,#{updateTime,jdbcType=TIMESTAMP}) ,#{updateTime,jdbcType=TIMESTAMP})
@ -135,6 +141,9 @@
<if test="paymentStatus != null">payment_status,</if> <if test="paymentStatus != null">payment_status,</if>
<if test="healthManageId != null">health_manage_id,</if> <if test="healthManageId != null">health_manage_id,</if>
<if test="healthManageName != null">health_manage_name,</if> <if test="healthManageName != null">health_manage_name,</if>
<if test="portaitCheckStatus != null">portait_check_status,</if>
<if test="portaitCheckPerson != null">portait_check_person,</if>
<if test="portaitCheckDate != null">portait_check_date,</if>
<if test="routeCheckStatus != null">route_check_status,</if> <if test="routeCheckStatus != null">route_check_status,</if>
<if test="routeCheckPerson != null">route_check_person,</if> <if test="routeCheckPerson != null">route_check_person,</if>
<if test="routeCheckDate != null">route_check_date,</if> <if test="routeCheckDate != null">route_check_date,</if>
@ -178,6 +187,9 @@
<if test="paymentStatus != null">#{paymentStatus,jdbcType=VARCHAR},</if> <if test="paymentStatus != null">#{paymentStatus,jdbcType=VARCHAR},</if>
<if test="healthManageId != null">#{healthManageId,jdbcType=BIGINT},</if> <if test="healthManageId != null">#{healthManageId,jdbcType=BIGINT},</if>
<if test="healthManageName != null">#{healthManageName,jdbcType=VARCHAR},</if> <if test="healthManageName != null">#{healthManageName,jdbcType=VARCHAR},</if>
<if test="portaitCheckStatus != null">#{portaitCheckStatus,jdbcType=VARCHAR},</if>
<if test="portaitCheckPerson != null">#{portaitCheckPerson,jdbcType=VARCHAR},</if>
<if test="portaitCheckDate != null">#{portaitCheckDate,jdbcType=TIMESTAMP},</if>
<if test="routeCheckStatus != null">#{routeCheckStatus,jdbcType=VARCHAR},</if> <if test="routeCheckStatus != null">#{routeCheckStatus,jdbcType=VARCHAR},</if>
<if test="routeCheckPerson != null">#{routeCheckPerson,jdbcType=VARCHAR},</if> <if test="routeCheckPerson != null">#{routeCheckPerson,jdbcType=VARCHAR},</if>
<if test="routeCheckDate != null">#{routeCheckDate,jdbcType=TIMESTAMP},</if> <if test="routeCheckDate != null">#{routeCheckDate,jdbcType=TIMESTAMP},</if>
@ -285,6 +297,15 @@
<if test="healthManageName != null"> <if test="healthManageName != null">
health_manage_name = #{healthManageName,jdbcType=VARCHAR}, health_manage_name = #{healthManageName,jdbcType=VARCHAR},
</if> </if>
<if test="portaitCheckStatus != null">
portait_check_status = #{portaitCheckStatus,jdbcType=VARCHAR},
</if>
<if test="portaitCheckPerson != null">
portait_check_person = #{portaitCheckPerson,jdbcType=VARCHAR},
</if>
<if test="portaitCheckDate != null">
portait_check_date = #{portaitCheckDate,jdbcType=TIMESTAMP},
</if>
<if test="routeCheckStatus != null"> <if test="routeCheckStatus != null">
route_check_status = #{routeCheckStatus,jdbcType=VARCHAR}, route_check_status = #{routeCheckStatus,jdbcType=VARCHAR},
</if> </if>
@ -349,6 +370,9 @@
payment_status = #{paymentStatus,jdbcType=VARCHAR}, payment_status = #{paymentStatus,jdbcType=VARCHAR},
health_manage_id = #{healthManageId,jdbcType=BIGINT}, health_manage_id = #{healthManageId,jdbcType=BIGINT},
health_manage_name = #{healthManageName,jdbcType=VARCHAR}, health_manage_name = #{healthManageName,jdbcType=VARCHAR},
portait_check_status = #{portaitCheckStatus,jdbcType=VARCHAR},
portait_check_person = #{portaitCheckPerson,jdbcType=VARCHAR},
portait_check_date = #{portaitCheckDate,jdbcType=TIMESTAMP},
route_check_status = #{routeCheckStatus,jdbcType=VARCHAR}, route_check_status = #{routeCheckStatus,jdbcType=VARCHAR},
route_check_person = #{routeCheckPerson,jdbcType=VARCHAR}, route_check_person = #{routeCheckPerson,jdbcType=VARCHAR},
route_check_date = #{routeCheckDate,jdbcType=TIMESTAMP}, route_check_date = #{routeCheckDate,jdbcType=TIMESTAMP},
@ -372,7 +396,7 @@
sign.visit_serial_number,sign.visit_method,sign.in_hospital_number,sign.sign_diagnosis,sign.review_diagnosis, sign.visit_serial_number,sign.visit_method,sign.in_hospital_number,sign.sign_diagnosis,sign.review_diagnosis,
sign.service_status,sign.sign_status,sign.intentional_source, sign.service_status,sign.sign_status,sign.intentional_source,
sign.intentional_time,sign.billing_doctor_name,sign.payment_status,sign.price,sign.health_manage_id, sign.health_manage_name, sign.intentional_time,sign.billing_doctor_name,sign.payment_status,sign.price,sign.health_manage_id, sign.health_manage_name,
sign.route_check_status, sign.route_check_status,sign.portait_check_status,
p.service_package_id, p.package_name, p.service_end_time, p.package_term, p.package_term_unit p.service_package_id, p.package_name, p.service_end_time, p.package_term, p.package_term_unit
from patient_info patient from patient_info patient
left join sign_patient_record sign on patient.sign_patient_record_id = sign.id left join sign_patient_record sign on patient.sign_patient_record_id = sign.id
@ -426,13 +450,13 @@
</if> </if>
<choose> <choose>
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'.toString()"> <when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'.toString()">
and sign.route_check_status is null and (sign.route_check_status is null or sign.portait_check_status is null)
</when> </when>
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'.toString()"> <when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'.toString()">
and sign.route_check_status = #{routeCheckStatus} and sign.route_check_status = #{routeCheckStatus} and sign.portait_check_status = #{routeCheckStatus}
</when> </when>
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'.toString()"> <when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'.toString()">
and sign.route_check_status = #{routeCheckStatus} and (sign.route_check_status = #{routeCheckStatus} or sign.portait_check_status = #{routeCheckStatus})
</when> </when>
</choose> </choose>
<if test="mainDiagnosis != null and mainDiagnosis != ''"> <if test="mainDiagnosis != null and mainDiagnosis != ''">