From f64707cf404a8a67b3c17ca0af07a501fda98766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9F=B3=E5=AE=87?= Date: Mon, 17 Jan 2022 17:36:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=84=E6=B5=A6=E5=85=A8=E7=A7=91=E5=AF=BC?= =?UTF-8?q?=E8=AF=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- .../src/main/resources/bootstrap-dev.yml | 4 +- .../src/main/resources/bootstrap-dev.yml | 6 +- .../src/main/resources/bootstrap-dev.yml | 4 +- .../mobile/HpGpIntelligentQAController.java | 64 +++++++++++++++++++ .../HpgpBusyIdlePredictionController.java | 34 ++++++++++ .../HpgpDiagnosticExperienceController.java | 57 +++++++++++++++++ .../dao/HpgpBusyIdlePredictionMapper.java | 14 ++++ .../hpgp/dao/HpgpDepartmentRankMapper.java | 23 +++++++ .../dao/HpgpDiagnosticExperienceMapper.java | 14 ++++ .../hpgp/dao/HpgpInspectionCheckMapper.java | 14 ++++ .../hpgp/model/HpgpBusyIdlePrediction.java | 41 ++++++++++++ .../theme/hpgp/model/HpgpDepartmentRank.java | 39 +++++++++++ .../hpgp/model/HpgpDiagnosticExperience.java | 39 +++++++++++ .../theme/hpgp/model/HpgpInspectionCheck.java | 36 +++++++++++ .../HpgpBusyIdlePredictionService.java | 23 +++++++ .../service/HpgpDepartmentRankService.java | 14 ++++ .../HpgpDiagnosticExperienceService.java | 14 ++++ .../service/HpgpInspectionCheckService.java | 14 ++++ .../HpgpBusyIdlePredictionServiceImpl.java | 47 ++++++++++++++ .../impl/HpgpDepartmentRankServiceImpl.java | 18 ++++++ .../HpgpDiagnosticExperienceServiceImpl.java | 18 ++++++ .../impl/HpgpInspectionCheckServiceImpl.java | 18 ++++++ .../theme/hpgp/vo/IntelligentAnswerVO.java | 50 +++++++++++++++ .../theme/hphy/constant/DataConstant.java | 11 ++++ .../mp/AppointmentGuideController.java | 15 +++++ .../controller/mp/HpDeptInfoController.java | 36 +++++++++++ ....java => HpHyIntelligentQAController.java} | 10 +-- .../mp/HphyPatientBaseController.java | 2 + .../controller/web/HpDeptInfoController.java | 26 -------- .../sict/theme/hphy/schedule/RefreshJob.java | 12 ++-- .../theme/hphy/service/HpDeptInfoService.java | 12 +++- .../service/impl/HpDeptInfoServiceImpl.java | 42 +++++++++++- .../stc/sict/theme/hphy/vo/DeptDoctorsVO.java | 22 +++++++ .../src/main/resources/bootstrap-dev.yml | 6 +- .../hpgp/HpgpBusyIdlePredictionMapper.xml | 17 +++++ .../mapper/hpgp/HpgpDepartmentRankMapper.xml | 21 ++++++ .../hpgp/HpgpDiagnosticExperienceMapper.xml | 17 +++++ .../mapper/hpgp/HpgpInspectionCheckMapper.xml | 14 ++++ 39 files changed, 819 insertions(+), 53 deletions(-) create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpGpIntelligentQAController.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpBusyIdlePredictionController.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpDiagnosticExperienceController.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpBusyIdlePredictionMapper.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDepartmentRankMapper.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDiagnosticExperienceMapper.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpInspectionCheckMapper.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpBusyIdlePrediction.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDepartmentRank.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDiagnosticExperience.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpInspectionCheck.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpBusyIdlePredictionService.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDepartmentRankService.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDiagnosticExperienceService.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpInspectionCheckService.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpBusyIdlePredictionServiceImpl.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDepartmentRankServiceImpl.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDiagnosticExperienceServiceImpl.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpInspectionCheckServiceImpl.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/vo/IntelligentAnswerVO.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/constant/DataConstant.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentGuideController.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpDeptInfoController.java rename smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/{IntelligentQAController.java => HpHyIntelligentQAController.java} (83%) delete mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/DeptDoctorsVO.java create mode 100644 smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpBusyIdlePredictionMapper.xml create mode 100644 smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml create mode 100644 smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDiagnosticExperienceMapper.xml create mode 100644 smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpInspectionCheckMapper.xml diff --git a/README.md b/README.md index fccf5dc..c94794b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# hphy +# hpgp -黄浦高血压精准导医 \ No newline at end of file +黄浦全科导医 diff --git a/cloud-auth/src/main/resources/bootstrap-dev.yml b/cloud-auth/src/main/resources/bootstrap-dev.yml index c0d208c..8d99621 100644 --- a/cloud-auth/src/main/resources/bootstrap-dev.yml +++ b/cloud-auth/src/main/resources/bootstrap-dev.yml @@ -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: diff --git a/cloud-gateway/src/main/resources/bootstrap-dev.yml b/cloud-gateway/src/main/resources/bootstrap-dev.yml index c5477f9..bed3b1e 100644 --- a/cloud-gateway/src/main/resources/bootstrap-dev.yml +++ b/cloud-gateway/src/main/resources/bootstrap-dev.yml @@ -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 diff --git a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-dev.yml b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-dev.yml index 32afb69..eb62c6f 100644 --- a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-dev.yml +++ b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-dev.yml @@ -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: diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpGpIntelligentQAController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpGpIntelligentQAController.java new file mode 100644 index 0000000..5996d2f --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpGpIntelligentQAController.java @@ -0,0 +1,64 @@ +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 = "\n" + + " \n" + + " \n" + + " " + DateUtil.now() + "\n" + + " \n" + + " \n" + + " " + IdWorker.getId() + "\n" + + ""; + // 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 result = XmlUtil.xmlToMap(body); + if(result.containsKey(CONTENT)){ + answerVO.setAnswer(MapUtil.getStr(result, CONTENT)); + } + + return new R<>(answerVO); + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpBusyIdlePredictionController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpBusyIdlePredictionController.java new file mode 100644 index 0000000..c968cb3 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpBusyIdlePredictionController.java @@ -0,0 +1,34 @@ +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)); + } + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpDiagnosticExperienceController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpDiagnosticExperienceController.java new file mode 100644 index 0000000..e7ce66d --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpgpDiagnosticExperienceController.java @@ -0,0 +1,57 @@ +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); + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpBusyIdlePredictionMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpBusyIdlePredictionMapper.java new file mode 100644 index 0000000..9176e03 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpBusyIdlePredictionMapper.java @@ -0,0 +1,14 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDepartmentRankMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDepartmentRankMapper.java new file mode 100644 index 0000000..8c1bb85 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDepartmentRankMapper.java @@ -0,0 +1,23 @@ +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 { + /** + * 根据标准科室名称查询医院科室排名 + * @param deptName 标准科室名称 + * @param size 查询记录数 默认3条 + * @return + */ + List getRankByStandardDept(@Param("deptName") String deptName, @Param("size") int size); +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDiagnosticExperienceMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDiagnosticExperienceMapper.java new file mode 100644 index 0000000..3b2d279 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpDiagnosticExperienceMapper.java @@ -0,0 +1,14 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpInspectionCheckMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpInspectionCheckMapper.java new file mode 100644 index 0000000..0a5a36a --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/dao/HpgpInspectionCheckMapper.java @@ -0,0 +1,14 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpBusyIdlePrediction.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpBusyIdlePrediction.java new file mode 100644 index 0000000..a6cf4f6 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpBusyIdlePrediction.java @@ -0,0 +1,41 @@ +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 { +//医院代码 +@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; + + + } diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDepartmentRank.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDepartmentRank.java new file mode 100644 index 0000000..66f1379 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDepartmentRank.java @@ -0,0 +1,39 @@ +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 { + //标准科室 + @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; + + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDiagnosticExperience.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDiagnosticExperience.java new file mode 100644 index 0000000..a55b2a8 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpDiagnosticExperience.java @@ -0,0 +1,39 @@ +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 { + //医院代码 + @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; + + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpInspectionCheck.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpInspectionCheck.java new file mode 100644 index 0000000..7211486 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpgpInspectionCheck.java @@ -0,0 +1,36 @@ +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 { + //医院代码 + @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; + + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpBusyIdlePredictionService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpBusyIdlePredictionService.java new file mode 100644 index 0000000..f83447f --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpBusyIdlePredictionService.java @@ -0,0 +1,23 @@ +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 { + + /** + * 忙闲预测 + * @param deptName 标准科室名称 + * @return 忙闲医院科室 + */ + List busyIdlePrediction(String deptName); +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDepartmentRankService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDepartmentRankService.java new file mode 100644 index 0000000..05b51a8 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDepartmentRankService.java @@ -0,0 +1,14 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDiagnosticExperienceService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDiagnosticExperienceService.java new file mode 100644 index 0000000..c44c65f --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpDiagnosticExperienceService.java @@ -0,0 +1,14 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpInspectionCheckService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpInspectionCheckService.java new file mode 100644 index 0000000..ce54c7e --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpgpInspectionCheckService.java @@ -0,0 +1,14 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpBusyIdlePredictionServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpBusyIdlePredictionServiceImpl.java new file mode 100644 index 0000000..5953ca0 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpBusyIdlePredictionServiceImpl.java @@ -0,0 +1,47 @@ +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 implements HpgpBusyIdlePredictionService { + private final HpgpDepartmentRankMapper departmentRankMapper; + + @Override + public List busyIdlePrediction(String deptName) { + // 查询科室排名 + // 组装医院代码、科室代码 + // 查询医院忙闲 + List deptRank = departmentRankMapper.getRankByStandardDept(deptName, 3); + if (CollectionUtil.isEmpty(deptRank)) { + return null; + } + Set hospitalCodes = deptRank.stream().map(HpgpDepartmentRank::getHospitalCode).collect(Collectors.toSet()); + Set deptCodes = deptRank.stream().map(HpgpDepartmentRank::getDeptCode).collect(Collectors.toSet()); + + return this.list( + new LambdaQueryWrapper() + .in(HpgpBusyIdlePrediction::getHospitalCode, hospitalCodes) + .in(HpgpBusyIdlePrediction::getDeptCode, deptCodes) + ); + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDepartmentRankServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDepartmentRankServiceImpl.java new file mode 100644 index 0000000..1b20e69 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDepartmentRankServiceImpl.java @@ -0,0 +1,18 @@ +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 implements HpgpDepartmentRankService { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDiagnosticExperienceServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDiagnosticExperienceServiceImpl.java new file mode 100644 index 0000000..146aa83 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpDiagnosticExperienceServiceImpl.java @@ -0,0 +1,18 @@ +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 implements HpgpDiagnosticExperienceService { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpInspectionCheckServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpInspectionCheckServiceImpl.java new file mode 100644 index 0000000..34b602c --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpgpInspectionCheckServiceImpl.java @@ -0,0 +1,18 @@ +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 implements HpgpInspectionCheckService { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/vo/IntelligentAnswerVO.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/vo/IntelligentAnswerVO.java new file mode 100644 index 0000000..d45ce1b --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/vo/IntelligentAnswerVO.java @@ -0,0 +1,50 @@ +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); + } + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/constant/DataConstant.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/constant/DataConstant.java new file mode 100644 index 0000000..d283260 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/constant/DataConstant.java @@ -0,0 +1,11 @@ +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; +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentGuideController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentGuideController.java new file mode 100644 index 0000000..468d950 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentGuideController.java @@ -0,0 +1,15 @@ +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 { + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpDeptInfoController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpDeptInfoController.java new file mode 100644 index 0000000..96851c4 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpDeptInfoController.java @@ -0,0 +1,36 @@ +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; + +/** + * (HpDeptInfo)维护接口 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +@Api(value = "[C] 黄浦预约——科室信息接口", tags = "[C] 黄浦预约——科室信息接口") +@RestController +@RequestMapping("/hphy/c/dept") +@AllArgsConstructor +public class HpDeptInfoController extends ApiController { + /** + * 服务对象 + */ + private final HpDeptInfoService hpDeptInfoService; + + @ApiOperation("科室医生查询接口") + public R getDeptDoctors(@ApiParam("医院代码") @RequestParam("hospitalCode") String hospitalCode, + @ApiParam("科室代码") @RequestParam("deptCode") String deptCode){ + return new R<>(hpDeptInfoService.getDeptDoctors(hospitalCode, deptCode)); + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/IntelligentQAController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpHyIntelligentQAController.java similarity index 83% rename from smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/IntelligentQAController.java rename to smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpHyIntelligentQAController.java index 7ec8935..5120252 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/IntelligentQAController.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HpHyIntelligentQAController.java @@ -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 = "\n" + " \n" + @@ -41,6 +41,8 @@ public class IntelligentQAController { " \n" + " " + IdWorker.getId() + "\n" + ""; + // 162 为黄浦高血压专病导医机器人 + // 51 黄浦高血压全科导诊机器人 String body = HttpRequest.post("http://30.30.5.74:9988/qa/jqrsvr.ashx?Command=talk_162") .body(xml) .execute() diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java index a89c689..645ab6c 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java @@ -54,6 +54,8 @@ public class HphyPatientBaseController { if (base != null) { patient.setId(base.getId()); + } else { + patient.setPhone(current.getPhone()); } // 身份证验证 if (StrUtil.isBlank(patient.getCertId())) { diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java deleted file mode 100644 index 2dab6a9..0000000 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.sh.stc.sict.theme.hphy.controller.web; - - -import cn.sh.stc.sict.theme.hphy.service.HpDeptInfoService; -import com.baomidou.mybatisplus.extension.api.ApiController; -import io.swagger.annotations.Api; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * (HpDeptInfo)维护接口 - * - * @author makejava - * @since 2021-01-28 10:35:58 - */ -@Api(value = "维护接口", tags = "维护接口") -@RestController -@RequestMapping("hpDeptInfo") -@AllArgsConstructor -public class HpDeptInfoController extends ApiController { - /** - * 服务对象 - */ - private final HpDeptInfoService hpDeptInfoService; -} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java index 1e454a6..122f41a 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java @@ -1,6 +1,7 @@ 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() .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 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() .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); diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java index 42e0d58..4cd0a84 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java @@ -1,6 +1,7 @@ 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 { - - -} \ No newline at end of file + /** + * 根据医院代码和科室代码查询医生信息 + * @param hospitalCode + * @param deptCode + * @return + */ + DeptDoctorsVO getDeptDoctors(String hospitalCode, String deptCode); +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java index 761ad5e..ac1c0f5 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java @@ -1,18 +1,58 @@ 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 implements HpDeptInfoService { + private final HpDocInfoMapper hpDocInfoMapper; + + @Override + public DeptDoctorsVO getDeptDoctors(String hospitalCode, String deptCode) { + // 查询科室信息 + // 查询医生信息 + HpDeptInfo deptInfo = this.getOne( + new LambdaQueryWrapper() + .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 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 doctors = hpDocInfoMapper.selectList(docWrapper); -} \ No newline at end of file + return new DeptDoctorsVO(deptInfo, doctors); + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/DeptDoctorsVO.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/DeptDoctorsVO.java new file mode 100644 index 0000000..546ee09 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/DeptDoctorsVO.java @@ -0,0 +1,22 @@ +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 doctors; +} diff --git a/smart-health-modules/theme-schema/src/main/resources/bootstrap-dev.yml b/smart-health-modules/theme-schema/src/main/resources/bootstrap-dev.yml index 99dbf7b..7cc253e 100644 --- a/smart-health-modules/theme-schema/src/main/resources/bootstrap-dev.yml +++ b/smart-health-modules/theme-schema/src/main/resources/bootstrap-dev.yml @@ -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} diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpBusyIdlePredictionMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpBusyIdlePredictionMapper.xml new file mode 100644 index 0000000..3d2d7c0 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpBusyIdlePredictionMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + hospital_code + , hospital_name, dept_code, dept_name, prediction_date, score + diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml new file mode 100644 index 0000000..822165c --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + standard_dept , hospital_code, hospital_name, dept_code, dept_name, rank_score + + + diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDiagnosticExperienceMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDiagnosticExperienceMapper.xml new file mode 100644 index 0000000..7ed8800 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDiagnosticExperienceMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + hospital_code + , hospital_name, dept_code, dept_name, diagnoses, total + diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpInspectionCheckMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpInspectionCheckMapper.xml new file mode 100644 index 0000000..8a982b3 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpInspectionCheckMapper.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + hospital_code, hospital_name, dept_code, dept_name, item_name + -- 2.22.0