陈昶聿
15 小时以前 2d3b575ed96eee7ccd5b324baa3135d2236934ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package com.ruoyi.quartz.controller;
 
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.quartz.service.ICollectHISService;
import com.ruoyi.datacollection.domain.HnDataGatherVO;
import com.ruoyi.common.core.domain.entity.Icd10;
import com.ruoyi.datacollection.service.IHNGatherPatArchiveService;
import com.smartor.common.SpecificArchiveConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@Slf4j
@RestController
@RequestMapping("/monitor/his")
@Api(description = "采集患者信息接口")
public class CollectHISController extends BaseController {
    @Autowired
    private ICollectHISService ichService;
 
    /**
     * 河南数据采集
     */
    @PostMapping("/collect")
    @ApiOperation("同步病人相关数据")
    public AjaxResult hnDataGather(@RequestBody HnDataGatherVO hnDataGatherVO) {
        try {
            Integer count =ichService.sync();
            return AjaxResult.success(count);
        } catch (Exception ex) {
            return AjaxResult.error(ex.getMessage());
        }
 
    }
 
    /**
     * 采集丽水市妇幼保健院门诊接诊完成记录,并生成妇科/儿科档案。
     * 请求体可传 startTime、endTime(yyyy-MM-dd 或 yyyy-MM-dd HH:mm:ss),不传默认采集昨天。
     */
    @PostMapping("/collectMchArchive")
    @ApiOperation("采集丽水妇幼门诊接诊完成记录并生成专科档案")
    public AjaxResult collectMchArchive(@RequestBody(required = false) HnDataGatherVO hnDataGatherVO) {
        try {
            HnDataGatherVO request = hnDataGatherVO != null ? hnDataGatherVO : new HnDataGatherVO();
            Integer count = ichService.collectMchOuthospAndGenerateArchive(
                    SpecificArchiveConstants.LISHUI_MCH_ORG_ID, request.getStartTime(), request.getEndTime());
            return AjaxResult.success(count);
        } catch (Exception ex) {
            log.error("采集丽水妇幼门诊接诊完成记录失败", ex);
            return AjaxResult.error(ex.getMessage());
        }
    }
 
    /**
     * 查询疾病列表数据采集
     */
    @PostMapping("/collectIcd10")
    @ApiOperation("同步标准诊断")
    public AjaxResult selectIcd10List(@RequestBody Icd10 icd10) {
        Integer integer = ichService.selectIcd10List(icd10);
        return AjaxResult.success(integer);
    }
 
    /**
     * 用户信息集合信息数据采集(异步执行,接口立即返回)
     */
    @PostMapping("/collectUser")
    @ApiOperation("同步用户信息")
    public AjaxResult selectUserList(@RequestBody SysUser sysUser) {
        boolean submitted = ichService.selectUserListAsync(sysUser);
        if (!submitted) {
            return AjaxResult.warn("用户信息同步任务正在执行中,请勿重复提交");
        }
        return AjaxResult.success("用户信息同步任务已提交,后台执行中,请通过日志查看进度");
    }
 
    /**
     * 部门信息集合信息数据采集
     */
    @PostMapping("/collectDept")
    @ApiOperation("同步科室信息")
    public AjaxResult selectDeptList(@RequestBody SysDept sysDept) {
        Integer integer = ichService.selectDeptList(sysDept);
        return AjaxResult.success(integer);
    }
 
}