suqinyi 1 vuosi sitten
vanhempi
commit
0f0d4f4f33

+ 41 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/DoctorRehabilitaionInfoController.java

@ -82,6 +82,25 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "getRehabilitationPatientCountNew", method = RequestMethod.GET)
    @ApiOperation("康复下转状态数量")
    public String getRehabilitationPatientListNew(
            @ApiParam(name = "doctorId", value = "医生id", required = false) @RequestParam(value = "doctorId", required = false) String doctorId
    ) {
        try {
            if (StringUtils.isBlank(doctorId)) {
                doctorId = getUID();
                System.out.println("获取康复下转居民列表--医生id==>getUID()==>" + getUID());
            }
            List<Map<String, Object>> list = rehabilitationInfoService.getRehabilitationPatientCountNew(doctorId);
            return write(200, "请求成功", "data", list);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    /**
     * 查询科室和医生
     */
@ -111,7 +130,6 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
            @ApiParam(name = "name", value = "模板名称", required = true) @RequestParam(value = "name", required = true) String name,
            @ApiParam(name = "content", value = "模板内容", required = true) @RequestParam(value = "content", required = true) String content
    ) {
        try {
            if (StringUtils.isBlank(doctorCode)) {
                doctorCode = getUID();
@ -249,6 +267,28 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
        }
    }
    /**
     * 查询康复计划服务项
     * 这个服务项还没有-暂时没有
     */
    @RequestMapping(value = "getPatientPlanItem", method = RequestMethod.GET)
    @ApiOperation("查询居民的康复计划")
    public String getPatientPlanItem(
            @ApiParam(name = "patientId", value = "居民", required = false) @RequestParam(value = "patientId", required = false) String patientId,
            @ApiParam(name = "planId", value = "计划id", required = false) @RequestParam(value = "planId", required = false) String planId,
            @ApiParam(name = "startTime", value = "开始时间", required = false) @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(name = "endTime", value = "结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(name = "doctorId", value = "医生id", required = false) @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "type", value = "1全部 2奔人 3 他人", required = false) @RequestParam(value = "type", required = false) String type
    ) {
        try {
            List<Map<String, Object>> result = rehabilitationInfoService.getPatientPlanItem(patientId, planId, startTime, endTime, doctorId, type);
            return write(200, "请求成功", "data", result);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "getDeorsumvergenceCount", method = RequestMethod.GET)
    @ApiOperation("康复下转已下转顶头数据")

+ 42 - 16
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationInfoService.java

@ -1024,12 +1024,12 @@ public class RehabilitationInfoService {
        String limitSql = " LIMIT " + (page - 1) * pagesize + "," + pagesize;
        String filterSql = "";
        if (StringUtils.isNotBlank(idcard)) {
            filterSql += " and d.idcard='" + idcard + "'";
            filterSql += " and d.idcard='" + idcard + "' ";
        }
        if (StringUtils.isBlank(status)) {
            //看全部数据
            filterSql += "	(AND d.create_user = '" + doctorId + "'  OR ISNULL(  d.create_user  ) )\n" +
                    "	AND ( ISNULL( d.type ) OR d.type = 2 ) ORDER BY d.create_time DESC ";
            filterSql += "	AND (d.create_user = '" + doctorId + "'  OR ISNULL(  d.create_user  ) )\n" +
                    "	    AND ( ISNULL( d.type ) OR d.type = 2 ) ORDER BY d.create_time DESC ";
            detailSql += filterSql + limitSql;
            countSql += filterSql;
            list = jdbcTemplate.queryForList(detailSql);
@ -1062,7 +1062,7 @@ public class RehabilitationInfoService {
            if ("7".equals(status)) {
                //已经分配医生
                filterSql += "	AND d.create_user = '" + doctorId + "'  OR ISNULL(  d.create_user  )\n" +
                filterSql += "	AND ( d.create_user = '" + doctorId + "'  OR ISNULL(  d.create_user  ) )  \n" +
                        "	AND ( ISNULL( d.type ) OR d.type = 2 ) and d.status='7' ";
                filterSql += " ORDER BY d.create_time DESC ";
                detailSql += filterSql + limitSql;
@ -1244,21 +1244,17 @@ public class RehabilitationInfoService {
        return map;
    }
    /**
     * todayTaskCount 今日任务项,等后面在整
     */
    public List<Map<String, Object>> getPatientRehabilitationByPatientId(String patientId) {
        String sql = "SELECT DISTINCT \n" +
                "	 a.id,a.`name`,a.birthday,a.phone,a.sex,a.mobile,c.age,\n" +
                "	 b.plan_doctor_name 'planDoctorName',d. `name` 'diseaseName',c.dept_name 'deptName',\n" +
                "	 b.`status` 'planStatus', \n" +
                "		(\n" +
                "			SELECT count(1) 	FROM wlyy_patient_rehabilitation_plan w \n" +
                "			INNER JOIN wlyy_rehabilitation_plan_detail q ON w.id = q.plan_id \n" +
                "			WHERE		1 = 1 	AND w.patient = a.id \n" +
                "		)'itemAllCount',\n" +
                "		(\n" +
                "			SELECT count(1) 	FROM wlyy_patient_rehabilitation_plan w \n" +
                "			INNER JOIN wlyy_rehabilitation_plan_detail q ON w.id = q.plan_id \n" +
                "			WHERE		1 = 1 	AND q.`status`='1'		AND w.patient = a.id \n" +
                "		)'finishCount'\n" +
                "	 b.`status` 'planStatus', c.hospital_name 'hospitalName',\n" +
                "	 (SELECT count(1) FROM wlyy_rehabilitation_plan_detail q WHERE	1 = 1 AND q.plan_id = b.id )'itemAllCount',\n" +
                "	 (SELECT count(1) FROM wlyy_rehabilitation_plan_detail q WHERE	1 = 1 AND q.`status`='1' AND q.plan_id = b.id )'finishCount',\n" +
                "	 0 'todayTaskCount'\n" +
                "FROM\n" +
                "	base_patient a\n" +
                "	INNER JOIN wlyy_patient_rehabilitation_plan b ON a.id = b.patient\n" +
@ -1266,11 +1262,41 @@ public class RehabilitationInfoService {
                "	INNER JOIN base_disease_hospital d ON  d.id=b.disease\n" +
                "WHERE\n" +
                "	1 = 1 \n" +
                "	AND a.del = '1'\n";
                "	AND a.del = '1' ";
        if (StringUtils.isNotBlank(patientId)) {
            sql += "	AND a.id='" + patientId + "' ";
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public List<Map<String, Object>> getRehabilitationPatientCountNew(String doctorId) {
        String sql = "SELECT\n" +
                "	CASE \n" +
                "		WHEN d.`status`='0' THEN '未下转'\n" +
                "		WHEN d.`status`='1' THEN '待分配'\n" +
                "		WHEN d.`status`='2' THEN '创建计划过程失败'\n" +
                "		WHEN d.`status`='3' THEN '患者无住院病历信息'\n" +
                "		WHEN d.`status`='5' THEN '同步居民失败'\n" +
                "		WHEN d.`status`='7' THEN '已管理'\n" +
                "  END 'statusName',\n" +
                "  d.`status`,count(1) 'count' \n" +
                "FROM\n" +
                "	base_patient p\n" +
                "	INNER JOIN wlyy_rehabilitation_patient_info d ON p.id = d.patient\n" +
                "	LEFT JOIN wlyy_patient_rehabilitation_plan q ON d.`code` = q.patient_info_code \n" +
                "WHERE\n" +
                "	1 = 1 \n" +
                " 	AND ( d.create_user = '" + doctorId + "'  OR q.plan_doctor='" + doctorId + "' OR ISNULL( d.create_user ) ) \n" +
                "	AND ( ISNULL( d.type ) OR d.type = 2 )\n" +
                "	GROUP BY d.`status`";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public List<Map<String, Object>> getPatientPlanItem(String patientId, String planId, String startTime, String endTime, String doctorId, String type) {
        String sql = " ";
        return null;
    }
}