Ver código fonte

Merge branch '2.0' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into 2.0

LAPTOP-KB9HII50\70708 1 ano atrás
pai
commit
1693c8622e

+ 11 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPatientInfoDO.java

@ -38,7 +38,17 @@ public class RehabilitationPatientInfoDO extends IdEntity {
    private String jwHospitalName;//社区医院名称
    private String hospitalDoctor;//转诊医生
    private Date createTime;//请求时间
    private Integer status;//是否分配下转:0未分配,1已分配(已下转列表),2已推送i健康 3患者无住院病历信息(等待重新下转),4不支持该医院自动下转,5添加居民失败,6下转列表(未下转-未签约)
    /**
     * 是否分配下转
     * 0未下转
     * 1待分配(已下转列表)
     * 2创建计划过程失败
     * 3患者无住院病历信息(等待重新下转)
     * 5同步居民失败
     * 7 已管理【康复计划已经分配了医生】
     */
    private Integer status;
    private String statusName;//是否分配下转:0未分配,1已分配(已下转列表),2已推送i健康,3患者无住院病历信息(等待重新下转),4不支持该医院自动下转,5添加居民失败,6下转列表(未下转)
    private String problemCode;//问题代码1001肺癌,1002慢性胃肠病,1003冠心病,1004慢性前列腺疾病,1005慢性乳腺疾病,
                               // 1006慢性阻塞性肺病,1007脂肪肝,1008慢性妇科炎症,1009脑卒中,1010慢性肾病

+ 3 - 5
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/DiagnosisInformationController.java

@ -25,8 +25,7 @@ public class DiagnosisInformationController extends EnvelopRestEndpoint {
    @Autowired
    private DiagnosisInformationService diagnosisInformationService;
//    @Autowired
//    private Tracer tracer;
    @PostMapping(value = SpecialistMapping.diagnosisInformation.createDiagnosisInformation)
    @ApiOperation(value = "诊疗信息创建")
@ -39,7 +38,6 @@ public class DiagnosisInformationController extends EnvelopRestEndpoint {
            return diagnosisInformationService.createDiagnosisInformation(diagnosisInformationDO);
        } catch (Exception e) {
            e.printStackTrace();
            // tracer.getCurrentSpan().logEvent(e.getMessage())
            return ObjEnvelop.getError(e.getMessage());
        }
    }
@ -52,7 +50,7 @@ public class DiagnosisInformationController extends EnvelopRestEndpoint {
            return diagnosisInformationService.findDiagnosisInformationByPlanId(planId);
        } catch (Exception e) {
            e.printStackTrace();
            // tracer.getCurrentSpan().logEvent(e.getMessage())
           
            return ObjEnvelop.getError(e.getMessage());
        }
    }
@ -69,7 +67,7 @@ public class DiagnosisInformationController extends EnvelopRestEndpoint {
            return diagnosisInformationService.findDiagnosisInformationByPatient(patient, page, size);
        } catch (Exception e) {
            e.printStackTrace();
            // tracer.getCurrentSpan().logEvent(e.getMessage())
           
            return ObjEnvelop.getError(e.getMessage());
        }
    }

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

@ -5,17 +5,16 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.specialist.rehabilitation.PatientMedicalRecordsDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationAdviceDO;
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationInfoService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.List;
@ -31,13 +30,35 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
    @Autowired
    private ObjectMapper objectMapper;
    /**
     * 查询患者基本信息
     */
    @GetMapping(value = "getPatientInfo")
    @ApiOperation(value = "查询患者基本信息")
    public MixEnvelop getPatientInfo(
            @ApiParam(name = "patientId", value = "居民id") @RequestParam(value = "patientId", required = false) String patientId,
            @ApiParam(name = "idcard", value = "身份证") @RequestParam(value = "idcard", required = false) String idcard
    ) {
        try {
            List<Map<String, Object>> list = rehabilitationInfoService.getPatientInfo(patientId,idcard);
            return MixEnvelop.getSuccess(SpecialistMapping.api_success, list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @RequestMapping(value = "getRehabilitationPatientList", method = RequestMethod.GET)
    /**
     * status
     * 是否分配下转:0未分配,1已分配(已下转列表),2创建计划过程失败,3患者无住院病历信息(等待重新下转) 5同步居民失败
     */
    @RequestMapping(value = "getRehabilitationPatientListNew", method = RequestMethod.GET)
    @ApiOperation("获取康复下转居民列表")
    public String getRehabilitationPatientList(
    public String getRehabilitationPatientListNew(
            @ApiParam(name = "doctorId", value = "医生id", required = false) @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "idcard", value = "身份证", required = false) @RequestParam(value = "idcard", required = false) String idcard,
            @ApiParam(name = "isTurnDown", value = "是否已下转 -2:未下转未家签,-1未下转 0未下转全部,;1已下转(未接收);2已下转(已接收);3已下转全部;03已下转全部+未下转全部", defaultValue = "0", required = false) @RequestParam(value = "isTurnDown", required = false, defaultValue = "3") String isTurnDown,
            @ApiParam(name = "status", value = "", defaultValue = "0", required = false) @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "page", value = "起始页", required = false) @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
            @ApiParam(name = "pagesize", value = "每页显示数据条数", required = false) @RequestParam(value = "pagesize", required = false, defaultValue = "10") Integer pagesize
    ) {
@ -52,21 +73,27 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
                doctorId = getUID();
                System.out.println("获取康复下转居民列表--医生id==>getUID()==>" + getUID());
            }
            JSONObject result = rehabilitationInfoService.getRehabilitationPatientList(idcard, doctorId, isTurnDown, page, pagesize);
            JSONObject result = rehabilitationInfoService.getRehabilitationPatientListNew(idcard, doctorId, status, page, pagesize);
            return write(200, "请求成功", "data", result);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "getDeorsumvergenceCount", method = RequestMethod.GET)
    @ApiOperation("康复下转已下转顶头数据")
    public String getDeorsumvergenceCount() {
    /**
     * 查询科室和医生
     */
    @RequestMapping(value = "getDetpAndDoctor", method = RequestMethod.GET)
    @ApiOperation("获取康复下转居民列表")
    public String getDetpAndDoctor(
            @ApiParam(name = "type", value = "类型1科室2医生", required = false) @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "disease", value = "疾病", required = false) @RequestParam(value = "disease", required = false) String disease,
            @ApiParam(name = "doctorName", value = "医生名字", required = false) @RequestParam(value = "doctorName", required = false) String doctorName,
            @ApiParam(name = "deptCode", value = "科室code", required = false) @RequestParam(value = "deptCode", required = false) String deptCode,
            @ApiParam(name = "deptName", value = "科室", required = false) @RequestParam(value = "deptName", required = false) String deptName) {
        try {
            JSONObject result = rehabilitationInfoService.getDeorsumvergenceCount(getUID());
            return write(200, "请求成功", "data", result);
            List<Map<String, Object>> list = rehabilitationInfoService.getDetpAndDoctor(doctorName, deptCode, deptName, type,disease);
            return write(200, "请求成功", "data", list);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
@ -120,6 +147,50 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "getRehabilitationPatientList", method = RequestMethod.GET)
    @ApiOperation("获取康复下转居民列表")
    public String getRehabilitationPatientList(
            @ApiParam(name = "doctorId", value = "医生id", required = false) @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "idcard", value = "身份证", required = false) @RequestParam(value = "idcard", required = false) String idcard,
            @ApiParam(name = "isTurnDown", value = "是否已下转 -2:未下转未家签,-1未下转 0未下转全部,;1已下转(未接收);2已下转(已接收);3已下转全部;03已下转全部+未下转全部", defaultValue = "0", required = false) @RequestParam(value = "isTurnDown", required = false, defaultValue = "3") String isTurnDown,
            @ApiParam(name = "page", value = "起始页", required = false) @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
            @ApiParam(name = "pagesize", value = "每页显示数据条数", required = false) @RequestParam(value = "pagesize", required = false, defaultValue = "10") Integer pagesize
    ) {
        try {
            if (page == null) {
                page = 1;
            }
            if (pagesize == null) {
                pagesize = 10;
            }
            if (StringUtils.isBlank(doctorId)) {
                doctorId = getUID();
                System.out.println("获取康复下转居民列表--医生id==>getUID()==>" + getUID());
            }
            JSONObject result = rehabilitationInfoService.getRehabilitationPatientList(idcard, doctorId, isTurnDown, page, pagesize);
            return write(200, "请求成功", "data", result);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "getDeorsumvergenceCount", method = RequestMethod.GET)
    @ApiOperation("康复下转已下转顶头数据")
    public String getDeorsumvergenceCount() {
        try {
            JSONObject result = rehabilitationInfoService.getDeorsumvergenceCount(getUID());
            return write(200, "请求成功", "data", result);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "createMedicalRecords", method = RequestMethod.POST)
    @ApiOperation("添加编辑住院病历")
    public String createMedicalRecords(

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

@ -270,7 +270,6 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
            List<PatientMedicalRecordsDO> result = rehabilitationManageService.findByPatient(patient);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            return error(-1, "请求失败");
        }
    }

+ 29 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/RehabilitationPlanController.java

@ -6,6 +6,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.hospital.module.rehabilitation.dao.RehabilitationOperateRecordsDao;
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationPlanService;
import com.yihu.jw.hospital.disease.dao.RehabilitationPlanTemplateDao;
import com.yihu.jw.hospital.disease.dao.RehabilitationTemplateDetailDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import com.yihu.jw.restmodel.web.Envelop;
@ -116,6 +118,30 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
        }
    }
    /**
     * 查询某个人的康复计划的服务项目
     */
    @GetMapping(value = "getRehabilitationDetailItemByPatient")
    @ApiOperation(value = "查询某个人的康复计划的服务项目")
    public MixEnvelop getRehabilitationDetailItemByPatient(
            @ApiParam(name = "patientId", value = "居民id") @RequestParam(value = "patientId", required = false) String patientId,
            @ApiParam(name = "planId", value = "计划id") @RequestParam(value = "planId", required = false) String planId
    ) {
        try {
            List<Map<String, Object>> list = rehabilitationPlanService.getRehabilitationDetailItemByPatient(patientId,planId);
            return MixEnvelop.getSuccess(SpecialistMapping.api_success, list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 查询服务项目
     * wlyy_rehabilitation_service_item
@ -158,6 +184,9 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    public ObjEnvelop deleteRehabilitationPlanTemplate(
            @ApiParam(name = "id", value = "康复模板id") @RequestParam(value = "id", required = true) String id) {
        try {
            if("system".equals(id)){
                return ObjEnvelop.getError("系统模板不允许删除");
            }
            return rehabilitationPlanService.deleteRehabilitationPlanTemplate(id);
        } catch (Exception e) {
            e.printStackTrace();

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

@ -520,15 +520,13 @@ public class RehabilitationInfoService {
//                "(   SELECT DISTINCT i.patient FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i,wlyy_patient p   WHERE i.create_user = '" + doctorCode + "' \n" +
//                "AND i. STATUS != 0 AND p. CODE = i.patient )GROUP BY d.patient ORDER BY d.create_time DESC ";
        String sql = "SELECT '' id, p.idcard,p.id 'patient',p.`name` patientName,p.sex,NULL age,p.address,\n" +
        String sql = "SELECT '' id, p.idcard,p.id 'patient',p.`name` patientName,p.sex,d.age,p.address,\n" +
                " if(p.sign_status=0,-2,-1) as isTurnDown  \n" +
                " FROM base_patient p \n" +
                " INNER JOIN wlyy_rehabilitation_patient_info d  ON p.id = d.patient and d.sign_status='1'  \n" +
                " INNER JOIN wlyy_rehabilitation_patient_info d  ON p.id = d.patient  \n" +
                " WHERE 1=1  " + filterSql +
                "	 and d.create_user ='" + doctorCode + "'  AND ( ISNULL(d.type) or d.type=2) AND  d.patient NOT IN( \n" +
                "	 SELECT DISTINCT i.patient FROM wlyy_patient_rehabilitation_plan i,base_patient p   \n" +
                "	 WHERE i.create_user = '" + doctorCode + "' AND i.`status` != 0 AND p.id = i.patient \n" +
                "	)\n" +
                "	 AND d.create_user ='" + doctorCode + "'  AND ( ISNULL(d.type) or d.type=2) \n" +
                "    AND d.`status`='0'\n" +
                "GROUP BY d.patient ORDER BY d.create_time DESC ";
        sql += " LIMIT " + (page - 1) * pagesize + "," + pagesize;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
@ -704,7 +702,7 @@ public class RehabilitationInfoService {
//                "WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
//                "AND s.expenses_status = 1 AND pr.patient=p.code and pr.team_code = i.team_code and pr.`status`>=0 and pr.sign_status=1 ";
        String sql2="SELECT i.disease_name diseaseName,p.idcard,p.sex, p.id 'patient',\n" +
        String sql2 = "SELECT i.disease_name diseaseName,p.idcard,p.sex, p.id 'patient',\n" +
                " CAST(IFNULL(p.birthday,'') AS char ) birthday, i.`status`, p.`name` patientName, p.address, \n" +
                " pr.is_manage isManage \n" +
                "FROM wlyy_patient_rehabilitation_plan i \n" +
@ -754,6 +752,11 @@ public class RehabilitationInfoService {
        JSONObject object = new JSONObject();
        List<Map<String, Object>> res = new ArrayList<>();
        if ("0".equals(isTurnDown)) {
            //未下转居民
            return noDown(idcard, doctorCode, page, pagesize, object);
        }
        if ("-2".equals(isTurnDown)) {
            //未下转未加签
            return noDownAndNoSign(idcard, doctorCode, page, pagesize, object);
@ -764,10 +767,6 @@ public class RehabilitationInfoService {
            return noDownAndSign(idcard, doctorCode, page, pagesize, object);
        }
        if ("0".equals(isTurnDown)) {
            //未下转居民
            return noDown(idcard, doctorCode, page, pagesize, object);
        }
        //用户同时被接收未接收,先取最近时间的,在查询
        if ("1".equals(isTurnDown)) {
            //未接收 1 已下转
@ -1052,4 +1051,137 @@ public class RehabilitationInfoService {
        List<RehabilitationAdviceDO> list = adviceDao.findByDoctor(doctorCode);
        return list;
    }
    public JSONObject getRehabilitationPatientListNew(String idcard, String doctorId, String status, Integer page, Integer pagesize) {
        JSONObject object = new JSONObject();
        List<Map<String, Object>> list = null;
        String detailSql = "SELECT \n" +
                " 	p.idcard,	p.id 'patientId', p.phone,	p.`name` 'patientName',	p.sex,	p.address, \n" +
                " 	d.ssc , d.mobile, d.age,	d.diagnosis_name 'diagnosisName',	d.sign_status,	d.dept 'deptCode', \n" +
                " 	d.dept_name 'deptName',	d.create_user 'createUserId', \n" +
                " 	d.create_user_name 'createUserName',DATE_FORMAT(d.create_time, '%Y-%m-%d %H:%i:%s') 'createTime',\n" +
                "	q.`status` 'planStaus',q.plan_doctor 'planDoctor', q.plan_doctor_name 'planDoctorName' ,\n" +
                "	DATE_FORMAT(q.create_time, '%Y-%m-%d %H:%i:%s') 'planCreateTime',d.ijk_id , " +
                "   d.problem_code,q.disease 'diseaseId',q.disease_name 'diseaseName' \n" +
                " FROM 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  " +
                " WHERE  1 = 1 ";
        String countSql = " select count(1) from base_patient p " +
                " INNER JOIN wlyy_rehabilitation_patient_info d ON p.id = d.patient " +
                " LEFT JOIN wlyy_patient_rehabilitation_plan q ON d.`code`=q.patient_info_code" +
                " WHERE  1 = 1   \n";
        String limitSql = " LIMIT " + (page - 1) * pagesize + "," + pagesize;
        String filterSql = "";
        if (StringUtils.isNotBlank(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 ";
            detailSql += filterSql + limitSql;
            countSql += filterSql;
            list = jdbcTemplate.queryForList(detailSql);
            Integer allCount = jdbcTemplate.queryForObject(countSql, Integer.class);
            object.put("allCount", allCount);
        }
        if (StringUtils.isNotBlank(status)) {
            if ("0".equals(status)) {
                //未下转的人
                filterSql += "	AND (d.create_user = '" + doctorId + "'  OR ISNULL(d.create_user)) AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                        " and d.status='0' ";
                filterSql += " ORDER BY d.create_time DESC ";
                detailSql += filterSql + limitSql;
                countSql += filterSql;
                list = jdbcTemplate.queryForList(detailSql);
                Integer unDownCount = jdbcTemplate.queryForObject(countSql, Integer.class);
                object.put("unDownCount", unDownCount);//未下转的人
            }
            if ("1".equals(status)) {
                //待分配的人
                filterSql += "	AND (d.create_user = '" + doctorId + "' OR ISNULL( d.create_user) )AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                        "   and d.status='1' ";
                filterSql += " ORDER BY d.create_time DESC ";
                detailSql += filterSql + limitSql;
                countSql += filterSql;
                list = jdbcTemplate.queryForList(detailSql);
                Integer unAllocationCount = jdbcTemplate.queryForObject(countSql, Integer.class);
                object.put("unAllocationCount", unAllocationCount);//待分配的人
            }
            if ("7".equals(status)) {
                //已经分配医生
                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;
                countSql += filterSql;
                list = jdbcTemplate.queryForList(detailSql);
                Integer allocation = jdbcTemplate.queryForObject(countSql, Integer.class);
                object.put("allocation", allocation);//已经分配
            }
        }
        object.put("data", list);
        return object;
    }
    /**
     * 根据疾病id查询科室
     * 根据科室查询医生
     */
    public List<Map<String, Object>> getDetpAndDoctor(String doctorName, String deptCode, String deptName, String type, String disease) {
        List<Map<String, Object>> list = null;
        if ("1".equals(type)) {
            String sql = "SELECT  DISTINCT b.id 'diseaseId' ,b.`name` 'diseaseName',a.* \n" +
                    "FROM\n" +
                    "	dict_hospital_dept a \n" +
                    "	INNER JOIN base_disease_hospital b ON FIND_IN_SET(a.`code`, b.dept) > 0 \n" +
                    "WHERE 1 =1\n";
            if (StringUtils.isNotBlank(deptName)) {
                sql += " and `name` LIKE '%" + deptName + "%'";
            }
            if (StringUtils.isNotBlank(disease)) {
                sql += "	AND b.id='" + disease + "' ";
            }
            list = jdbcTemplate.queryForList(sql);
        }
        if ("2".equals(type)) {
            String sql = "SELECT b.id 'doctorId',b.`name` 'doctorName' FROM base_doctor_hospital a \n" +
                    "INNER JOIN base_doctor  b ON a.doctor_code=b.id \n" +
                    "WHERE  1=1 ";
            if (StringUtils.isNotBlank(deptCode)) {
                sql += " and dept_code = '" + deptCode + "' ";
            }
            if (StringUtils.isNotBlank(doctorName)) {
                sql += " and b.`name` LIKE '%" + deptName + "%'";
            }
            list = jdbcTemplate.queryForList(sql);
        }
        return list;
    }
    public List<Map<String, Object>> getPatientInfo(String patientId, String idcard) {
        String sql = "SELECT\n" +
                "	b.sign_status 'signStatus',\n" +
                "	CASE \n" +
                "	 WHEN b.sign_status='1' THEN '已家签'\n" +
                "	 WHEN b.sign_status='0' THEN '未家签'\n" +
                "	END 'signStatusName',\n" +
                "	a.* \n" +
                "FROM\n" +
                "	base_patient a\n" +
                "	LEFT JOIN wlyy_rehabilitation_patient_info b ON a.id = b.patient \n" +
                "WHERE\n" +
                "	1 = 1 \n" +
                "	AND a.del = 1\n";
        if (StringUtils.isNotBlank(patientId)) {
            sql += "	AND a.id='" + patientId + "'\n";
        }
        if (StringUtils.isNotBlank(idcard)) {
            sql += "	AND a.idcard='" + idcard + "'\n";
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}

+ 24 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationPlanService.java

@ -502,7 +502,8 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        String detailSql = "SELECT \n" +
                "  (SELECT GROUP_CONCAT(b.`name`) FROM 	wlyy_rehabilitation_template_detail q \n" +
                "	 INNER JOIN wlyy_rehabilitation_service_item b ON q.hospital_service_item_id=b.`code` WHERE q.template_id=a.id) 'itemName',\n" +
                "	a.*\n";
                "	DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%i:%s') 'createTime'," +
                "   DATE_FORMAT(a.update_time, '%Y-%m-%d %H:%i:%s') 'updateTime', a.* \n";
        String sql = " FROM	wlyy_rehabilitation_plan_template a WHERE 1=1\n";
        String pageSql = "";
        if (StringUtils.isNotBlank(templateId)) {
@ -590,8 +591,12 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
    }
    public ListEnvelop findFrequencyList() {
        String sql = " SELECT * FROM `base`.`wlyy_frequency` WHERE del='1' ";
        List<Frequency> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Frequency.class));
        //        String sql = " SELECT * FROM `base`.`wlyy_frequency` WHERE del='1' ";
//        List<Frequency> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Frequency.class));
//        return ListEnvelop.getSuccess(SpecialistMapping.api_success, list);
        String sql = " SELECT dict_code 'code',dict_value 'name' from wlyy_hospital_sys_dict WHERE dict_name = 'plan_frequency' ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return ListEnvelop.getSuccess(SpecialistMapping.api_success, list);
    }
@ -847,4 +852,20 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        List<Map<String,Object>> planLogList = jdbcTemplate.queryForList(sql);
        return planLogList;
    }
    public List<Map<String, Object>> getRehabilitationDetailItemByPatient(String patientId, String planId) {
        String sql="SELECT\n" +
                "	b.title 'planTitle', c.`name` 'itemName' ,b.`status` 'planStatus',a.* \n" +
                "FROM\n" +
                "	wlyy_rehabilitation_plan_detail a\n" +
                "	INNER JOIN wlyy_patient_rehabilitation_plan b ON a.plan_id=b.id\n" +
                "	INNER JOIN wlyy_rehabilitation_service_item c ON a.hospital_service_item_id=c.`id`\n" +
                "	WHERE 1=1 \n" +
                "	AND a.plan_id='"+planId+"'\n" +
                "	AND b.patient='"+patientId+"' ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}