فهرست منبع

Merge branch 'dev' of zd_123/patient-co-management into dev

yeshijie 7 سال پیش
والد
کامیت
ee7b08abfb

+ 20 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -735,7 +735,7 @@ public class PrescriptionInfoService extends BaseService {
        return 1;
    }
    public List<Map<String, Object>> getDoctorPrescription(Integer teamCode, String state, String diseases, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size) {
    public List<Map<String, Object>> getDoctorPrescription(Integer teamCode, String state, String diseases, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size,String isPcim) {
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " p.`name`, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
@ -758,11 +758,11 @@ public class PrescriptionInfoService extends BaseService {
                    " WHERE s.prescription_code = pr.code " +
                    " AND s.health_problem = ?");
            params.add(diseases);
            setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size);
            setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size, isPcim);
        } else {
            //查询所有疾病类型表
            pre_sql.append(" WHERE 1=1 ");
            setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size);
            setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size, isPcim);
        }
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(), params.toArray());
@ -775,14 +775,29 @@ public class PrescriptionInfoService extends BaseService {
        return rs;
    }
    public void setSQL(StringBuffer pre_sql, List<Object> params, Integer teamCode, String state, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size) {
    public void setSQL(StringBuffer pre_sql, List<Object> params, Integer teamCode, String state, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size, String isPcim) {
        if (teamCode != null && teamCode > 0) {
            pre_sql.append(" AND pr.admin_team_id =?");
            params.add(teamCode);
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status IN (" + state + ") ");
            //不是pcim新改的用原来的接口-2018.03.09
            if (StringUtils.isNotBlank(isPcim) && "0".equals(isPcim)){
                pre_sql.append(" AND pr.status IN (" + state + ") ");
            }else if (StringUtils.isNotBlank(isPcim) && "1".equals(isPcim)){
                //如果是pcim新改的则状态搜索改变
                //待审核和已完成
                if ("0".equals(state)  || "100".equals(state)){
                    pre_sql.append(" AND pr.status IN (" + state + ") ");
                }else if ("-1".equals(state)){
                    //已取消
                    pre_sql.append(" AND pr.status < (-1) ");
                }else if ("1".equals(state)){
                    //已完成
                    pre_sql.append(" AND pr.status > 0 AND pr.status <100 ");
                }
            }
        }
        if (StringUtils.isNotBlank(startDate)) {
            pre_sql.append(" AND pr.create_time >= ? ");

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -113,6 +113,8 @@ public class PrescriptionInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/getDoctorPrescription", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生/建管师续方列表/搜索")
    public String getDoctorPrescription(@RequestParam(required = false) @ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
@ -123,9 +125,10 @@ public class PrescriptionInfoController extends BaseController {
                                        @RequestParam(required = false) @ApiParam(name = "nameKeyword", value = "患者姓名模糊匹配") String nameKeyword,
                                        @RequestParam(required = false) @ApiParam(name = "patient", value = "患者Code") String patient,
                                        @RequestParam(required = false) @ApiParam(name = "page", value = "起始页") Integer page,
                                        @RequestParam(required = false) @ApiParam(name = "size", value = "每页条数") Integer size) {
                                        @RequestParam(required = false) @ApiParam(name = "size", value = "每页条数") Integer size,
                                        @RequestParam(required = false , defaultValue = "0") @ApiParam(name = "isPcim",value = "是否在pcim上使用,0否1是")String isPcim) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getDoctorPrescription(teamCode, state, diseases, startDate, endDate, nameKeyword, patient, page, size));
            return write(200, "查询成功!", "data", prescriptionInfoService.getDoctorPrescription(teamCode, state, diseases, startDate, endDate, nameKeyword, patient, page, size,isPcim));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");