Commit f64707cf authored by 张柳宇's avatar 张柳宇

黄浦全科导诊

parent 9b37b63f
# hphy
# hpgp
黄浦高血压精准导医
\ No newline at end of file
黄浦全科导医
......@@ -11,9 +11,9 @@ spring:
nacos:
server-addr: 127.0.0.1:8848
discovery:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
config:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
file-extension: yml
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
shared-configs:
......
......@@ -9,9 +9,9 @@ spring:
nacos:
server-addr: 127.0.0.1:8848
discovery:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
config:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
file-extension: yml
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
profiles:
......@@ -20,4 +20,4 @@ spring:
logging:
config: classpath:logback-spring.xml
file:
name: ../logs/${spring.application.name}/console.log
\ No newline at end of file
name: ../logs/${spring.application.name}/console.log
......@@ -11,9 +11,9 @@ spring:
nacos:
server-addr: 127.0.0.1:8848
discovery:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
config:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
file-extension: yml
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
profiles:
......
package cn.sh.stc.sict.theme.hpgp.controller.mobile;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.XmlUtil;
import cn.hutool.http.HttpRequest;
import cn.sh.stc.sict.cloud.common.core.util.R;
import cn.sh.stc.sict.cloud.common.security.util.SecurityUtils;
import cn.sh.stc.sict.cloud.upms.dto.CurrentUser;
import cn.sh.stc.sict.theme.hpgp.vo.IntelligentAnswerVO;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author F_xh
*/
@Slf4j
@RestController
@AllArgsConstructor
@Api(tags = "[C]黄浦精准预约——智能问答")
@RequestMapping("/hpgp/c/intelligent/qa")
public class HpGpIntelligentQAController {
private final static String CONTENT = "Content";
@ApiOperation("智能问答")
@PostMapping
public R<?> qa(String question) {
CurrentUser current = SecurityUtils.getCurrentUser();
String from = StrUtil.isNotBlank(current.getOpenId()) ? current.getOpenId() : current.getId().toString();
String xml = "<xml>\n" +
" <ToUserName><![CDATA[gh_fe5b36b12c61]]></ToUserName>\n" +
" <FromUserName><![CDATA[" + from + "]]></FromUserName>\n" +
" <CreateTime>" + DateUtil.now() + "</CreateTime>\n" +
" <MsgType><![CDATA[text]]></MsgType>\n" +
" <Content><![CDATA[" + question + "]]></Content>\n" +
" <MsgId>" + IdWorker.getId() + "</MsgId>\n" +
"</xml>";
// 162 为黄浦高血压专病导医机器人
// 51 黄浦高血压全科导诊机器人
String body = HttpRequest.post("http://30.30.5.74:9988/qa/jqrsvr.ashx?Command=talk_51")
.body(xml)
.execute()
.body();
log.error("孙总接口请求 xml = {}", xml);
log.error("孙总接口返回 body = {}", body);
IntelligentAnswerVO answerVO = new IntelligentAnswerVO();
Map<String, Object> result = XmlUtil.xmlToMap(body);
if(result.containsKey(CONTENT)){
answerVO.setAnswer(MapUtil.getStr(result, CONTENT));
}
return new R<>(answerVO);
}
}
package cn.sh.stc.sict.theme.hpgp.controller.mobile;
import cn.sh.stc.sict.cloud.common.core.util.R;
import cn.sh.stc.sict.theme.hpgp.service.HpgpBusyIdlePredictionService;
import com.baomidou.mybatisplus.extension.api.ApiController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 黄浦全科导诊——忙闲预测(HpgpBusyIdlePrediction)维护接口
*
* @author zhangly
* @since 2022-01-14 09:56:44
*/
@Api(value = "[C] 黄浦全科导诊——忙闲预测维护接口", tags = "[C] 黄浦全科导诊——忙闲预测维护接口")
@RestController
@RequestMapping("/hpgp/c/busyidleprediction")
@AllArgsConstructor
public class HpgpBusyIdlePredictionController extends ApiController {
/**
* 服务对象
*/
private final HpgpBusyIdlePredictionService hpgpBusyIdlePredictionService;
public R<?> busyIdlePrediction(@ApiParam("标准") @RequestParam("deptName") String deptName){
return new R<>().success(hpgpBusyIdlePredictionService.busyIdlePrediction(deptName));
}
}
package cn.sh.stc.sict.theme.hpgp.controller.mobile;
import cn.sh.stc.sict.cloud.common.core.util.R;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDiagnosticExperience;
import cn.sh.stc.sict.theme.hpgp.service.HpgpDiagnosticExperienceService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* 黄浦全科导诊——诊断经验云词(HpgpDiagnosticExperience)维护接口
*
* @author zhangly
* @since 2022-01-14 09:56:49
*/
@Api(value = "[C] 黄浦全科导诊——诊断经验云词维护接口", tags = "[C] 黄浦全科导诊——诊断经验云词维护接口")
@RestController
@RequestMapping("/hpgp/c/dia/exp")
@AllArgsConstructor
public class HpgpDiagnosticExperienceController extends ApiController {
/**
* 服务对象
*/
private final HpgpDiagnosticExperienceService hpgpDiagnosticExperienceService;
/**
* 分页查询
*
* @param page 分页对象
* @param hpgpDiagnosticExperience 黄浦全科导诊——诊断经验云词
* @return
*/
@ApiOperation("分页查询")
@GetMapping("/page")
public R<?> getHpgpDiagnosticExperiencePage(Page page, HpgpDiagnosticExperience hpgpDiagnosticExperience) {
page = hpgpDiagnosticExperienceService.page(page, Wrappers.query(hpgpDiagnosticExperience));
return new R<>(page);
}
/**
* 新增机构信息表
* 黄浦全科导诊——诊断经验云词
* @param hpgpDiagnosticExperience
* @return R
*/
@ApiOperation("新增/修改")
@PostMapping
public R<?> save(@RequestBody HpgpDiagnosticExperience hpgpDiagnosticExperience) {
hpgpDiagnosticExperienceService.saveOrUpdate(hpgpDiagnosticExperience);
return new R<>(hpgpDiagnosticExperience);
}
}
package cn.sh.stc.sict.theme.hpgp.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction;
/**
* 黄浦全科导诊——忙闲预测(HpgpBusyIdle_ prediction)表数据库访问层
*
* @author zhangly
* @since 2022-01-14 09:56:41
*/
public interface HpgpBusyIdlePredictionMapper extends BaseMapper<HpgpBusyIdlePrediction> {
}
package cn.sh.stc.sict.theme.hpgp.dao;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 黄浦全科导诊——科室排名(HpgpDepartmentRank)表数据库访问层
*
* @author zhangly
* @since 2022-01-14 09:56:47
*/
public interface HpgpDepartmentRankMapper extends BaseMapper<HpgpDepartmentRank> {
/**
* 根据标准科室名称查询医院科室排名
* @param deptName 标准科室名称
* @param size 查询记录数 默认3条
* @return
*/
List<HpgpDepartmentRank> getRankByStandardDept(@Param("deptName") String deptName, @Param("size") int size);
}
package cn.sh.stc.sict.theme.hpgp.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDiagnosticExperience;
/**
* 黄浦全科导诊——诊断经验云词(HpgpDiagnosticExperience)表数据库访问层
*
* @author zhangly
* @since 2022-01-14 09:56:48
*/
public interface HpgpDiagnosticExperienceMapper extends BaseMapper<HpgpDiagnosticExperience> {
}
package cn.sh.stc.sict.theme.hpgp.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpInspectionCheck;
/**
* 黄浦全科导诊——检验检查云词(HpgpInspectionCheck)表数据库访问层
*
* @author zhangly
* @since 2022-01-14 09:56:49
*/
public interface HpgpInspectionCheckMapper extends BaseMapper<HpgpInspectionCheck> {
}
package cn.sh.stc.sict.theme.hpgp.model;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 黄浦全科导诊——忙闲预测(HpgpBusyIdle_ prediction)表实体类
*
* @author zhangly
* @since 2022-01-14 09:56:39
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class HpgpBusyIdlePrediction extends Model<HpgpBusyIdlePrediction> {
//医院代码
@ApiModelProperty(hidden = false, value = "医院代码")
private String hospitalCode;
//医院名称
@ApiModelProperty(hidden = false, value = "医院名称")
private String hospitalName;
//科室代码
@ApiModelProperty(hidden = false, value = "科室代码")
private String deptCode;
//科室名称
@ApiModelProperty(hidden = false, value = "科室名称")
private String deptName;
//预测日期
@ApiModelProperty(hidden = false, value = "预测日期")
private Date predictionDate;
//忙闲评分
@ApiModelProperty(hidden = false, value = "忙闲评分")
private Integer score;
}
package cn.sh.stc.sict.theme.hpgp.model;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 黄浦全科导诊——科室排名(HpgpDepartmentRank)表实体类
*
* @author zhangly
* @since 2022-01-14 09:56:47
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class HpgpDepartmentRank extends Model<HpgpDepartmentRank> {
//标准科室
@ApiModelProperty(hidden = false, value = "标准科室")
private String standardDept;
//医院代码
@ApiModelProperty(hidden = false, value = "医院代码")
private String hospitalCode;
//医院名称
@ApiModelProperty(hidden = false, value = "医院名称")
private String hospitalName;
//科室代码
@ApiModelProperty(hidden = false, value = "科室代码")
private String deptCode;
//科室名称
@ApiModelProperty(hidden = false, value = "科室名称")
private String deptName;
//科室排名
@ApiModelProperty(hidden = false, value = "科室排名")
private Integer rankScore;
}
package cn.sh.stc.sict.theme.hpgp.model;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 黄浦全科导诊——诊断经验云词(HpgpDiagnosticExperience)表实体类
*
* @author zhangly
* @since 2022-01-14 09:56:48
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class HpgpDiagnosticExperience extends Model<HpgpDiagnosticExperience> {
//医院代码
@ApiModelProperty(hidden = false, value = "医院代码")
private String hospitalCode;
//医院名称
@ApiModelProperty(hidden = false, value = "医院名称")
private String hospitalName;
//科室代码
@ApiModelProperty(hidden = false, value = "科室代码")
private String deptCode;
//科室名称
@ApiModelProperty(hidden = false, value = "科室名称")
private String deptName;
//诊断名称
@ApiModelProperty(hidden = false, value = "诊断名称")
private String diagnoses;
//诊断总数
@ApiModelProperty(hidden = false, value = "诊断总数")
private Integer total;
}
package cn.sh.stc.sict.theme.hpgp.model;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 黄浦全科导诊——检验检查云词(HpgpInspectionCheck)表实体类
*
* @author zhangly
* @since 2022-01-14 09:56:49
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class HpgpInspectionCheck extends Model<HpgpInspectionCheck> {
//医院代码
@ApiModelProperty(hidden = false, value = "医院代码")
private String hospitalCode;
//医院名称
@ApiModelProperty(hidden = false, value = "医院名称")
private String hospitalName;
//科室代码
@ApiModelProperty(hidden = false, value = "科室代码")
private String deptCode;
//科室名称
@ApiModelProperty(hidden = false, value = "科室名称")
private String deptName;
//检验检查项目名称
@ApiModelProperty(hidden = false, value = "检验检查项目名称")
private String itemName;
}
package cn.sh.stc.sict.theme.hpgp.service;
import cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 黄浦全科导诊——忙闲预测(HpgpBusyIdle_ prediction)表服务接口
*
* @author zhangly
* @since 2022-01-14 09:56:42
*/
public interface HpgpBusyIdlePredictionService extends IService<HpgpBusyIdlePrediction> {
/**
* 忙闲预测
* @param deptName 标准科室名称
* @return 忙闲医院科室
*/
List<HpgpBusyIdlePrediction> busyIdlePrediction(String deptName);
}
package cn.sh.stc.sict.theme.hpgp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank;
/**
* 黄浦全科导诊——科室排名(HpgpDepartmentRank)表服务接口
*
* @author zhangly
* @since 2022-01-14 09:56:47
*/
public interface HpgpDepartmentRankService extends IService<HpgpDepartmentRank> {
}
package cn.sh.stc.sict.theme.hpgp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDiagnosticExperience;
/**
* 黄浦全科导诊——诊断经验云词(HpgpDiagnosticExperience)表服务接口
*
* @author zhangly
* @since 2022-01-14 09:56:48
*/
public interface HpgpDiagnosticExperienceService extends IService<HpgpDiagnosticExperience> {
}
package cn.sh.stc.sict.theme.hpgp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.sh.stc.sict.theme.hpgp.model.HpgpInspectionCheck;
/**
* 黄浦全科导诊——检验检查云词(HpgpInspectionCheck)表服务接口
*
* @author zhangly
* @since 2022-01-14 09:56:49
*/
public interface HpgpInspectionCheckService extends IService<HpgpInspectionCheck> {
}
package cn.sh.stc.sict.theme.hpgp.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.sh.stc.sict.theme.hpgp.dao.HpgpBusyIdlePredictionMapper;
import cn.sh.stc.sict.theme.hpgp.dao.HpgpDepartmentRankMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank;
import cn.sh.stc.sict.theme.hpgp.service.HpgpBusyIdlePredictionService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 黄浦全科导诊——忙闲预测(HpgpBusyIdle_ prediction)表服务实现类
*
* @author zhangly
* @since 2022-01-14 09:56:43
*/
@AllArgsConstructor
@Service("hpgpBusyIdlPredictionService")
public class HpgpBusyIdlePredictionServiceImpl extends ServiceImpl<HpgpBusyIdlePredictionMapper, HpgpBusyIdlePrediction> implements HpgpBusyIdlePredictionService {
private final HpgpDepartmentRankMapper departmentRankMapper;
@Override
public List<HpgpBusyIdlePrediction> busyIdlePrediction(String deptName) {
// 查询科室排名
// 组装医院代码、科室代码
// 查询医院忙闲
List<HpgpDepartmentRank> deptRank = departmentRankMapper.getRankByStandardDept(deptName, 3);
if (CollectionUtil.isEmpty(deptRank)) {
return null;
}
Set<String> hospitalCodes = deptRank.stream().map(HpgpDepartmentRank::getHospitalCode).collect(Collectors.toSet());
Set<String> deptCodes = deptRank.stream().map(HpgpDepartmentRank::getDeptCode).collect(Collectors.toSet());
return this.list(
new LambdaQueryWrapper<HpgpBusyIdlePrediction>()
.in(HpgpBusyIdlePrediction::getHospitalCode, hospitalCodes)
.in(HpgpBusyIdlePrediction::getDeptCode, deptCodes)
);
}
}
package cn.sh.stc.sict.theme.hpgp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.sh.stc.sict.theme.hpgp.dao.HpgpDepartmentRankMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank;
import cn.sh.stc.sict.theme.hpgp.service.HpgpDepartmentRankService;
import org.springframework.stereotype.Service;
/**
* 黄浦全科导诊——科室排名(HpgpDepartmentRank)表服务实现类
*
* @author zhangly
* @since 2022-01-14 09:56:47
*/
@Service("hpgpDepartmentRankService")
public class HpgpDepartmentRankServiceImpl extends ServiceImpl<HpgpDepartmentRankMapper, HpgpDepartmentRank> implements HpgpDepartmentRankService {
}
package cn.sh.stc.sict.theme.hpgp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.sh.stc.sict.theme.hpgp.dao.HpgpDiagnosticExperienceMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpDiagnosticExperience;
import cn.sh.stc.sict.theme.hpgp.service.HpgpDiagnosticExperienceService;
import org.springframework.stereotype.Service;
/**
* 黄浦全科导诊——诊断经验云词(HpgpDiagnosticExperience)表服务实现类
*
* @author zhangly
* @since 2022-01-14 09:56:48
*/
@Service("hpgpDiagnosticExperienceService")
public class HpgpDiagnosticExperienceServiceImpl extends ServiceImpl<HpgpDiagnosticExperienceMapper, HpgpDiagnosticExperience> implements HpgpDiagnosticExperienceService {
}
package cn.sh.stc.sict.theme.hpgp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.sh.stc.sict.theme.hpgp.dao.HpgpInspectionCheckMapper;
import cn.sh.stc.sict.theme.hpgp.model.HpgpInspectionCheck;
import cn.sh.stc.sict.theme.hpgp.service.HpgpInspectionCheckService;
import org.springframework.stereotype.Service;
/**
* 黄浦全科导诊——检验检查云词(HpgpInspectionCheck)表服务实现类
*
* @author zhangly
* @since 2022-01-14 09:56:49
*/
@Service("hpgpInspectionCheckService")
public class HpgpInspectionCheckServiceImpl extends ServiceImpl<HpgpInspectionCheckMapper, HpgpInspectionCheck> implements HpgpInspectionCheckService {
}
package cn.sh.stc.sict.theme.hpgp.vo;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author zhangly
* @Description
* @Date 2022/1/14 10:50
**/
@Data
public class IntelligentAnswerVO {
public void setAnswer(String answer) {
this.answer = answer;
if (StrUtil.isNotBlank(answer)){
parseDept();
}
}
public IntelligentAnswerVO(String answer) {
this.answer = answer;
if (StrUtil.isNotBlank(answer)){
parseDept();
}
}
public IntelligentAnswerVO(String answer, String deptName) {
this.answer = answer;
this.deptName = deptName;
}
public IntelligentAnswerVO() {
}
private String answer;
private String deptName;
private void parseDept() {
String reg = "分析和推荐的就诊科室为:(.*)\\n?(";
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(answer);
if(m.find()){
deptName = m.group(1);
}
}
}
package cn.sh.stc.sict.theme.hphy.constant;
/**
* @author zhangly
* @Description
* @Date 2022/1/14 14:13
**/
public class DataConstant {
public static final Byte TOP_DEPT = 1;
public static final Byte TWO_DEPT = 2;
}
package cn.sh.stc.sict.theme.hphy.controller.mp;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author zhangly
* @Description
* @Date 2022/1/11 16:44
**/
@RestController
@RequestMapping("/c/guide")
public class AppointmentGuideController {
}
package cn.sh.stc.sict.theme.hphy.controller.web;
package cn.sh.stc.sict.theme.hphy.controller.mp;
import cn.sh.stc.sict.cloud.common.core.util.R;
import cn.sh.stc.sict.theme.hphy.service.HpDeptInfoService;
import com.baomidou.mybatisplus.extension.api.ApiController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
......@@ -14,13 +18,19 @@ import org.springframework.web.bind.annotation.RestController;
* @author makejava
* @since 2021-01-28 10:35:58
*/
@Api(value = "维护接口", tags = "维护接口")
@Api(value = "[C] 黄浦预约——科室信息接口", tags = "[C] 黄浦预约——科室信息接口")
@RestController
@RequestMapping("hpDeptInfo")
@RequestMapping("/hphy/c/dept")
@AllArgsConstructor
public class HpDeptInfoController extends ApiController {
/**
* 服务对象
*/
private final HpDeptInfoService hpDeptInfoService;
}
\ No newline at end of file
@ApiOperation("科室医生查询接口")
public R<?> getDeptDoctors(@ApiParam("医院代码") @RequestParam("hospitalCode") String hospitalCode,
@ApiParam("科室代码") @RequestParam("deptCode") String deptCode){
return new R<>(hpDeptInfoService.getDeptDoctors(hospitalCode, deptCode));
}
}
......@@ -22,16 +22,16 @@ import java.util.Map;
@Slf4j
@RestController
@AllArgsConstructor
@Api(tags = "[C]智能问答")
@RequestMapping("/c/intelligent/qa")
public class IntelligentQAController {
@Api(tags = "[C]黄浦高血压专病导医——智能问答")
@RequestMapping("/hphy/c/intelligent/qa")
public class HpHyIntelligentQAController {
private final static String CONTENT = "Content";
@ApiOperation("智能问答")
@PostMapping
public R qa(String question) {
CurrentUser current = SecurityUtils.getCurrentUser();
String from = null != current ? (StrUtil.isNotBlank(current.getOpenId()) ? current.getOpenId() : current.getId().toString()) : IdWorker.getIdStr();
String from = StrUtil.isNotBlank(current.getOpenId()) ? current.getOpenId() : current.getId().toString();
String xml = "<xml>\n" +
" <ToUserName><![CDATA[gh_fe5b36b12c61]]></ToUserName>\n" +
......@@ -41,6 +41,8 @@ public class IntelligentQAController {
" <Content><![CDATA[" + question + "]]></Content>\n" +
" <MsgId>" + IdWorker.getId() + "</MsgId>\n" +
"</xml>";
// 162 为黄浦高血压专病导医机器人
// 51 黄浦高血压全科导诊机器人
String body = HttpRequest.post("http://30.30.5.74:9988/qa/jqrsvr.ashx?Command=talk_162")
.body(xml)
.execute()
......
......@@ -54,6 +54,8 @@ public class HphyPatientBaseController {
if (base != null) {
patient.setId(base.getId());
} else {
patient.setPhone(current.getPhone());
}
// 身份证验证
if (StrUtil.isBlank(patient.getCertId())) {
......
package cn.sh.stc.sict.theme.hphy.schedule;
import cn.hutool.core.collection.CollectionUtil;
import cn.sh.stc.sict.theme.hphy.constant.DataConstant;
import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo;
import cn.sh.stc.sict.theme.hphy.model.HpDocInfo;
import cn.sh.stc.sict.theme.hphy.model.HpHosInfo;
......@@ -38,9 +39,6 @@ public class RefreshJob {
private final HpDeptInfoService deptInfoService;
private final HpDocInfoService docInfoService;
private static final byte TOP_DEPT = 1;
private static final byte TWO_DEPT = 2;
/**
* 每月一日0点 更新医院信息
*/
......@@ -150,7 +148,7 @@ public class RefreshJob {
new LambdaQueryWrapper<HpDeptInfo>()
.eq(HpDeptInfo::getHosOrgCode, hpDeptInfo.getHosOrgCode())
.eq(HpDeptInfo::getOneDeptCode, hpDeptInfo.getOneDeptCode())
.eq(HpDeptInfo::getDeptLevel, TOP_DEPT)
.eq(HpDeptInfo::getDeptLevel, DataConstant.TOP_DEPT)
);
if (deptInfo != null) {
hpDeptInfo.setId(deptInfo.getId());
......@@ -172,7 +170,7 @@ public class RefreshJob {
List<HpDeptInfo> hpDeptInfos = factory.getMapperFacade().mapAsList(deptInfos, HpDeptInfo.class);
for (HpDeptInfo hpDeptInfo : hpDeptInfos) {
hpDeptInfo.setDeptLevel(TWO_DEPT);
hpDeptInfo.setDeptLevel(DataConstant.TWO_DEPT);
saveOrUpdateTwoDept(hpDeptInfo);
}
}
......@@ -183,7 +181,7 @@ public class RefreshJob {
new LambdaQueryWrapper<HpDeptInfo>()
.eq(HpDeptInfo::getHosOrgCode, hpDeptInfo.getHosOrgCode())
.eq(HpDeptInfo::getDeptCode, hpDeptInfo.getDeptCode())
.eq(HpDeptInfo::getDeptLevel, TWO_DEPT)
.eq(HpDeptInfo::getDeptLevel, DataConstant.TWO_DEPT)
);
if (deptInfo != null) {
hpDeptInfo.setId(deptInfo.getId());
......@@ -208,7 +206,7 @@ public class RefreshJob {
hpDeptInfo.setNormdeptCode(deptInfo.getNormdeptCode());
hpDeptInfo.setNormdeptName(deptInfo.getNormdeptName());
hpDeptInfo.setDeptDesc(deptInfo.getDeptDesc());
hpDeptInfo.setDeptLevel(TOP_DEPT);
hpDeptInfo.setDeptLevel(DataConstant.TOP_DEPT);
hpDeptInfo.setIndexNo(deptInfo.getIndexNo());
hpDeptInfos.add(hpDeptInfo);
......
package cn.sh.stc.sict.theme.hphy.service;
import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo;
import cn.sh.stc.sict.theme.hphy.vo.DeptDoctorsVO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
......@@ -11,6 +12,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface HpDeptInfoService extends IService<HpDeptInfo> {
}
\ No newline at end of file
/**
* 根据医院代码和科室代码查询医生信息
* @param hospitalCode
* @param deptCode
* @return
*/
DeptDoctorsVO getDeptDoctors(String hospitalCode, String deptCode);
}
package cn.sh.stc.sict.theme.hphy.service.impl;
import cn.sh.stc.sict.theme.hphy.constant.DataConstant;
import cn.sh.stc.sict.theme.hphy.dao.HpDeptInfoMapper;
import cn.sh.stc.sict.theme.hphy.dao.HpDocInfoMapper;
import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo;
import cn.sh.stc.sict.theme.hphy.model.HpDocInfo;
import cn.sh.stc.sict.theme.hphy.service.HpDeptInfoService;
import cn.sh.stc.sict.theme.hphy.vo.DeptDoctorsVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* (HpDeptInfo)表服务实现类
*
* @author makejava
* @since 2021-01-28 10:35:58
*/
@Slf4j
@AllArgsConstructor
@Service("hpDeptInfoService")
public class HpDeptInfoServiceImpl extends ServiceImpl<HpDeptInfoMapper, HpDeptInfo> implements HpDeptInfoService {
private final HpDocInfoMapper hpDocInfoMapper;
@Override
public DeptDoctorsVO getDeptDoctors(String hospitalCode, String deptCode) {
// 查询科室信息
// 查询医生信息
HpDeptInfo deptInfo = this.getOne(
new LambdaQueryWrapper<HpDeptInfo>()
.eq(HpDeptInfo::getHosOrgCode, hospitalCode)
.and(i -> i.eq(HpDeptInfo::getOneDeptCode, deptCode)
.or().eq(HpDeptInfo::getDeptCode, deptCode))
.orderByDesc(HpDeptInfo::getDeptLevel)
);
if (deptInfo == null){
log.error("根据医院编码:{} 和科室编码:{} 未查出科室信息", hospitalCode, deptCode);
return null;
}
LambdaQueryWrapper<HpDocInfo> docWrapper = new LambdaQueryWrapper<>();
docWrapper.eq(HpDocInfo::getHosOrgCode, hospitalCode);
docWrapper.eq(HpDocInfo::getOneDeptCode, deptInfo.getOneDeptCode());
if (DataConstant.TWO_DEPT.equals(deptInfo.getDeptLevel())){
docWrapper.eq(HpDocInfo::getDeptCode, deptInfo.getDeptCode());
}
docWrapper.orderByAsc(HpDocInfo::getIndexNo);
List<HpDocInfo> doctors = hpDocInfoMapper.selectList(docWrapper);
}
\ No newline at end of file
return new DeptDoctorsVO(deptInfo, doctors);
}
}
package cn.sh.stc.sict.theme.hphy.vo;
import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo;
import cn.sh.stc.sict.theme.hphy.model.HpDocInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zhangly
* @Description
* @Date 2022/1/14 14:43
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeptDoctorsVO {
private HpDeptInfo deptInfo;
private List<HpDocInfo> doctors;
}
......@@ -11,8 +11,8 @@ spring:
nacos:
server-addr: 127.0.0.1:8848
discovery:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
config:
namespace: bbe7ca0d-f409-4e68-bf95-5f2adad168e7
namespace: be9383c3-e535-4e9c-81ab-a8c6b7ecdc82
file-extension: yml
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
\ No newline at end of file
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.sh.stc.sict.theme.hpgp.dao.HpgpBusyIdlePredictionMapper">
<resultMap type="cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction" id="HpgpBusyIdle_ predictionMap">
<result property="hospitalCode" column="hospital_code"/>
<result property="hospitalName" column="hospital_name"/>
<result property="deptCode" column="dept_code"/>
<result property="deptName" column="dept_name"/>
<result property="predictionDate" column="prediction_date"/>
<result property="score" column="score"/>
</resultMap>
<sql id="Base_Column_List">
hospital_code
, hospital_name, dept_code, dept_name, prediction_date, score </sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.sh.stc.sict.theme.hpgp.dao.HpgpDepartmentRankMapper">
<resultMap type="cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank" id="HpgpDepartmentRankMap">
<result property="standardDept" column="standard_dept"/>
<result property="hospitalCode" column="hospital_code"/>
<result property="hospitalName" column="hospital_name"/>
<result property="deptCode" column="dept_code"/>
<result property="deptName" column="dept_name"/>
<result property="rankScore" column="rank_score"/>
</resultMap>
<sql id="Base_Column_List"> standard_dept , hospital_code, hospital_name, dept_code, dept_name, rank_score </sql>
<select id="getRankByStandardDept">
select
<include refid="Base_Column_List" />
from hpgp_department_rank where standard_dept = #{deptName} order by rank_score asc limit #{size}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.sh.stc.sict.theme.hpgp.dao.HpgpDiagnosticExperienceMapper">
<resultMap type="cn.sh.stc.sict.theme.hpgp.model.HpgpDiagnosticExperience" id="HpgpDiagnosticExperienceMap">
<result property="hospitalCode" column="hospital_code"/>
<result property="hospitalName" column="hospital_name"/>
<result property="deptCode" column="dept_code"/>
<result property="deptName" column="dept_name"/>
<result property="diagnoses" column="diagnoses"/>
<result property="total" column="total"/>
</resultMap>
<sql id="Base_Column_List">
hospital_code
, hospital_name, dept_code, dept_name, diagnoses, total </sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.sh.stc.sict.theme.hpgp.dao.HpgpInspectionCheckMapper">
<resultMap type="cn.sh.stc.sict.theme.hpgp.model.HpgpInspectionCheck" id="HpgpInspectionCheckMap">
<result property="hospitalCode" column="hospital_code"/>
<result property="hospitalName" column="hospital_name"/>
<result property="deptCode" column="dept_code"/>
<result property="deptName" column="dept_name"/>
<result property="itemName" column="item_name"/>
</resultMap>
<sql id="Base_Column_List">hospital_code, hospital_name, dept_code, dept_name, item_name</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment