Bladeren bron

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

trick9191 7 jaren geleden
bovenliggende
commit
1c34e054b6

+ 67 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DiseaseConvert.java

@ -0,0 +1,67 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.wlyy.entity.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.etl.convert.wlyy.model.HealthLable;
import com.yihu.wlyy.statistics.etl.convert.wlyy.model.PrescriptionDisease;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.beans.BeanUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 长处方疾病
 * Created by zhangdan on 2017/10/26.
 */
public class DiseaseConvert implements Convert {
    @Override
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp) {
        List<DataModel> returnList = new ArrayList<>();
        Map<String, List<String>> prescriptionDiseaseMap = new HashMap<>();//key是处方code value是处方标签 1高血压 2糖尿病
        //初始化标签Map
        initHealthLabesMap(jdbcTemplate, prescriptionDiseaseMap);
        //把标签Map设置到对应的维度里面
        for (DataModel dataModel : oneList) {
            List<String> healthProblems = prescriptionDiseaseMap.get(dataModel.getPrescriptionCode());
            if (healthProblems != null && healthProblems.size() > 0) {
                healthProblems.stream().forEach(str -> {
                    try {
                        DataModel dataModelTemp = new DataModel();
                        BeanUtils.copyProperties(dataModel, dataModelTemp);
                        DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(dataModelTemp, str);
                        returnList.add(dataModelTemp);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                });
            }
        }
        return returnList;
    }
    private void initHealthLabesMap(JdbcTemplate jdbcTemplate, Map<String, List<String>> prescriptionDiseaseMap) {
        //得到长处方的疾病标签(只要高血压 糖尿病)
        String sql = "SELECT " +
                "  health_problem ," +
                "  prescription_code " +
                "FROM " +
                "  wlyy_prescription_diagnosis " +
                "WHERE " +
                "  health_problem = 'HP0047' " +
                "OR health_problem = 'HP0093' ";
        List<PrescriptionDisease> prescriptionDiseases = jdbcTemplate.query(sql, new BeanPropertyRowMapper(PrescriptionDisease.class));
        prescriptionDiseases.stream().forEach(one -> {
            List<String> labels = prescriptionDiseaseMap.get(one.getPrescriptionCode());
            if (labels == null) {
                labels = new ArrayList<String>();
            }
            labels.add(one.getHealthProblem());
            prescriptionDiseaseMap.put(one.getPrescriptionCode(), labels);
        });
    }
}

+ 55 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/PrescriptionStatusConvert.java

@ -0,0 +1,55 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.wlyy.entity.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.etl.convert.wlyy.model.PrescriptionDisease;
import com.yihu.wlyy.statistics.util.Contant;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.beans.BeanUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 长处方疾病
 * Created by zhangdan on 2017/10/26.
 */
public class PrescriptionStatusConvert implements Convert {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
                //获取到prescriptionCode,求长处方状态
                String sql ="SELECT status FROM wlyy_prescription WHERE code=?";
                //int status = jdbcTemplate.queryForObject(sql, Integer.class);
                Object[] args = {value};
                int status=jdbcTemplate.queryForObject(sql,args,Integer.class);
                String key = getStatusCode(status);
                DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(one, key);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        return oneList;
    }
    public String getStatusCode(Integer status) {
        if (status >= 0 && status <= 100) {
            return Contant.prescriptionStatus.status_1;
        } else if (status==100) {
            return Contant.prescriptionStatus.status_2;
        } else if (status==-2) {
            return Contant.prescriptionStatus.status_3;
        } else if (status==-1) {
            return Contant.prescriptionStatus.status_4;
        } else if (status==-3) {
            return Contant.prescriptionStatus.status_5;
        } else{
            return "0";
        }
    }
}

+ 26 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/model/PrescriptionDisease.java

@ -0,0 +1,26 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy.model;
/**
 * Created by zhangdan on 2017/10/26.
 */
public class PrescriptionDisease {
    private String healthProblem;
    private String prescriptionCode;
    public String getHealthProblem() {
        return healthProblem;
    }
    public void setHealthProblem(String healthProblem) {
        this.healthProblem = healthProblem;
    }
    public String getPrescriptionCode() {
        return prescriptionCode;
    }
    public void setPrescriptionCode(String prescriptionCode) {
        this.prescriptionCode = prescriptionCode;
    }
}

+ 38 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/Contant.java

@ -139,4 +139,42 @@ public class Contant {
        public static String level_age_5_name="51~65";
        public static String level_age_6_name=">65";
    }
    public static class prescriptionStatus{
        public static String status_1="1";
        public static String status_2="2";
        public static String status_3="3";
        public static String status_4="4";
        public static String status_5="5";
        public static String status_6="6";
        public static String status_7="7";
        public static String status_8="8";
        public static String status_9="9";
        public static String status_10="10";
        public static String status_11="11";
        public static String status_12="12";
        public static String status_13="13";
//        public static String status_1_name="续方取消";
//        public static String status_2_name="审核不通过";
//        public static String status_3_name="审核中";
//        public static String status_4_name="药师审核中";
//        public static String status_5_name="药师审核失败";
//        public static String status_6_name="开方中/药师审核成功";
//        public static String status_7_name="开方失败/预结算失败";
//        public static String status_8_name="待支付";
//        public static String status_9_name="支付成功/待配药";
//        public static String status_10_name="等待领药";
//        public static String status_11_name="配送中";
//        public static String status_12_name="已完成";
//        public static String status_13_name="进行中";
        public static String status_1_name="进行中";//大于0小于100
        public static String status_2_name="已完成";//100
        public static String status_3_name="已取消";//患者取消,-2
        public static String status_4_name="审核不通过";//-1;
        public static String status_5_name="其他原因取消";//支付超时,-3;
    }
}

+ 8 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/DataModel.java

@ -22,6 +22,8 @@ public class DataModel {
    private String serverType;//服务类型
    private String healthLable;//健康标签
    private Double num=1.0;//分数 如果是累加的计算 默认是1 如果是分数从数据库拿
    private String prescriptionCode;//处方code
    public String getHealthLable() {
        return healthLable;
@ -173,4 +175,10 @@ public class DataModel {
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPrescriptionCode() { return prescriptionCode; }
    public void setPrescriptionCode(String prescriptionCode) {
        this.prescriptionCode = prescriptionCode;
    }
}

+ 92 - 35
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionDispensaryCode;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.entity.statistics.PopulationBase;
import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
@ -189,7 +190,7 @@ public class StatisticsESService {
    public long getIntervalIncrement(String startDate, String endDate, String area, int level, String index) throws Exception {
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,area,level,index,"1");
        return saveModel.getResult2().longValue();
        return saveModel.getResult2();
    }
//    /**
@ -270,7 +271,7 @@ public class StatisticsESService {
        }else{
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,area,level,index,"1");
        }
        return saveModel.getResult2().longValue();
        return saveModel.getResult2();
    }
    /**
@ -321,9 +322,9 @@ public class StatisticsESService {
                map.put("code",saveModel.getTeam());
                map.put("name",saveModel.getCityName());
            }
            map.put("amount",saveModel.getResult2().longValue());
            map.put("amount",Long.parseLong(saveModel.getResult2()+""));
            map.put("rate",df.format((saveModel.getResult2() * 1.0000) / populationBase.getNum() * 100));
            map.put("rateString",saveModel.getResult2().longValue()+"/"+populationBase.getNum());
            map.put("rateString",saveModel.getResult2()+"/"+populationBase.getNum());
            resultList.add(map);
        }
        Collections.sort(resultList, new Comparator<Map<String, Object>>() {
@ -359,7 +360,7 @@ public class StatisticsESService {
            Map<String, Object> map = new HashMap<>();
            map.put("code",saveModel.getSlaveKey1());
            map.put("name",saveModel.getSlaveKey1Name());
            map.put("amount",saveModel.getResult2().longValue());
            map.put("amount",Long.parseLong(saveModel.getResult2()+""));
            if (index.equals("7")) {
                // 分组指标总数算法
                String code = saveModel.getSlaveKey2();
@ -441,7 +442,7 @@ public class StatisticsESService {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,index,timeLevel);
        return saveModel.getResult2().longValue();
        return saveModel.getResult2();
    }
    /**
@ -455,7 +456,7 @@ public class StatisticsESService {
    public long getWeiJiaoFei(String endDate, String area, int level) throws Exception{
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate,area,level,"16","2","0");
        return saveModel.getResult2().longValue();
        return saveModel.getResult2();
    }
@ -477,12 +478,12 @@ public class StatisticsESService {
        }
        String timeKey = elasticsearchUtil.getQuotaTime();
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey,area,Integer.parseInt(level),renewIndex,"2");
        int renewNum = saveModel.getResult2().intValue();
        int renewNum = saveModel.getResult2();
        //根据年度获取去年的签约数 签约指标是1
        String date = year + "-06-30";
        String index = "1";
        SaveModel saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(date,area,Integer.parseInt(level),index,"2");
        int signNum = saveModel2.getResult2().intValue();
        int signNum = saveModel2.getResult2();
        JSONObject jo = new JSONObject();
        jo.put("yesterYearSign", signNum);//去年的签约量
        jo.put("thisYearRenew", renewNum);//今年的续签量
@ -501,7 +502,7 @@ public class StatisticsESService {
    public JSONObject getSignRate(String endDate, String area, int level, String year) throws Exception {
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"13","2");
        long signAmount = saveModel.getResult2().longValue();
        long signAmount = saveModel.getResult2();
        PopulationBase peopleNum = getPopulationBase(area, year);
        JSONObject json = new JSONObject();
        DecimalFormat df = new DecimalFormat("0.0000");
@ -532,7 +533,7 @@ public class StatisticsESService {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"13","2");
        long signAmount = saveModel.getResult2().longValue();
        long signAmount = saveModel.getResult2();
        PopulationBase peopleNum = getPopulationBase(area, year);
        DecimalFormat df = new DecimalFormat("0.0000");
        JSONObject json = new JSONObject();
@ -563,7 +564,7 @@ public class StatisticsESService {
        List<SaveModel> list = elasticsearchUtil.findDateQuotaLevel1(endDate,endDate,area,level,"17","2",lowCode,null,null);
        long total = 0;
        if(list.size()>0){
            total = list.get(0).getResult2().longValue();
            total = list.get(0).getResult2();
        }
        int num = 0;
        int taskNum = 0;
@ -675,7 +676,7 @@ public class StatisticsESService {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate,area,level,"8","2","6");
        return saveModel.getResult2().longValue();
        return saveModel.getResult2();
    }
    /**
@ -727,7 +728,7 @@ public class StatisticsESService {
        for (SaveModel saveModel:list) {
            JSONObject range = new JSONObject();
            range.put("range", df.format(saveModel.getQuotaDate()));
            range.put("amount", saveModel.getResult2().longValue());
            range.put("amount", saveModel.getResult2());
            result.add(range);
        }
        json.put("data", new ArrayList<>(result));
@ -1026,7 +1027,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult2().longValue());
                maps.put("amount", one.getResult1());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1250,7 +1251,7 @@ public class StatisticsESService {
                    JSONObject jo = new JSONObject();
                    jo.put("name", one.getTownName());
                    jo.put("code", one.getTown());
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                    ja.put(jo);
                });
            } else {
@ -1259,7 +1260,7 @@ public class StatisticsESService {
                    JSONObject jo = new JSONObject();
                    jo.put("name", one.getHospitalName());
                    jo.put("code", one.getHospital());
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                    ja.put(jo);
                });
            }
@ -1269,7 +1270,7 @@ public class StatisticsESService {
                JSONObject jo = new JSONObject();
                jo.put("name", one.getHospitalName());
                jo.put("code", one.getHospital());
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                ja.put(jo);
            });
        } else if (level == 2) {
@ -1279,7 +1280,7 @@ public class StatisticsESService {
                JSONObject jo = new JSONObject();
                jo.put("name", one.getTeam());
                jo.put("code", one.getTeamName());
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                ja.put(jo);
            });
            translateTeamLeaderName(ja);
@ -1311,7 +1312,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult2().intValue());
                maps.put("amount", one.getResult1());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1405,7 +1406,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult2().intValue());
                maps.put("amount", one.getResult1());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1680,9 +1681,9 @@ public class StatisticsESService {
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getResult2().intValue();
            Integer relyNm = relyRs.getResult2().intValue();
            Integer noRelyNm = onRelyRs.getResult2().intValue();
            Integer totalNm = totalRs.getResult2();
            Integer relyNm = relyRs.getResult2();
            Integer noRelyNm = onRelyRs.getResult2();
//            rs.put("name", relyRs.get(area+"Name"));
            if(level==4){
                rs.put("name", relyRs.getHospitalName());
@ -1875,9 +1876,9 @@ public class StatisticsESService {
        //合并结果集
        Map<String, Object> rs = new HashMap<>();
        Integer totalNm = total.getResult2().intValue();
        Integer relyNm = rely.getResult2().intValue();
        Integer noRelyNm = onRely.getResult2().intValue();
        Integer totalNm = total.getResult2();
        Integer relyNm = rely.getResult2();
        Integer noRelyNm = onRely.getResult2();
//        rs.put("name", rely.get(area + "Name"));
        if (SaveModel.cityLevel.equals(level+"")) {
            rs.put("code", rely.getCity());
@ -1970,8 +1971,8 @@ public class StatisticsESService {
                //转签量
                switchSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(timeKey,area,level,renewIndex,"2");
            }
            int renewNum = renewSaveModel.getResult2().intValue();
            int switchNum = switchSaveModel.getResult2().intValue();
            int renewNum = renewSaveModel.getResult2();
            int switchNum = switchSaveModel.getResult2();
            //根据年度获取去年的签约数 签约指标是1
            if(StringUtils.isNoneBlank(lowCode)){
@ -1991,7 +1992,7 @@ public class StatisticsESService {
                signSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,signIndex,"2");
            }
            //签约量
            int signNum = signSaveModel.getResult2().intValue();
            int signNum = signSaveModel.getResult2();
            jo.put("yesterYearSign", signNum);//去年的签约量
            jo.put("thisYearRenew", renewNum);//今年的续签量
            jo.put("thisYearSwithch", switchNum);//今年的转签量
@ -2056,7 +2057,7 @@ public class StatisticsESService {
    private int getLevel1NumForRedis(String index, String level, String code, String timeKey) throws Exception{
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey,code,Integer.parseInt(level),index,"2");
        return saveModel.getResult2().intValue();
        return saveModel.getResult2();
    }
    /**
     * 通用的方法 获取二级维度的数据列表
@ -2214,11 +2215,11 @@ public class StatisticsESService {
        if (renewSaveModels != null && renewSaveModels.size() > 0) {
            for (SaveModel saveModel : renewSaveModels) {
                if ("3".equals(low_level)) {
                    renewMap.put(saveModel.getTown(), saveModel.getResult2().intValue());
                    renewMap.put(saveModel.getTown(), saveModel.getResult2());
                } else if ("4".equals(low_level)) {
                    renewMap.put(saveModel.getHospital(), saveModel.getResult2().intValue());
                    renewMap.put(saveModel.getHospital(), saveModel.getResult2());
                } else if ("5".equals(low_level)) {
                    renewMap.put(saveModel.getTeam(), saveModel.getResult2().intValue());
                    renewMap.put(saveModel.getTeam(), saveModel.getResult2());
                } else {
                    continue;
                }
@ -2267,7 +2268,7 @@ public class StatisticsESService {
                    int signNum = 0;
                    int renewNum = renewMap.get(reMap.get("code").toString());
                    if (one != null) {
                        signNum = one.getResult2().intValue();
                        signNum = Integer.valueOf(one.getResult2());
                    }
                    reMap.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
                    reMap.put("signNum", signNum);
@ -2378,4 +2379,60 @@ public class StatisticsESService {
        Double avgCout = saveModel2.getResult1()/(Integer)map.get("num");
        return null;
    }
    public Map<String,Object> getPrescriptionCount(int level,String area,String disease) throws Exception{
        String index ="58";
        Map<String,Object> rs = new HashedMap();
        //总数
        List<SaveModel> totalList =  elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        //进行中
        List<SaveModel> processingList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"1");
        //已完成
        List<SaveModel> finishedList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"2");
        //已经取消
        List<SaveModel> canceledList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"3");
        //审核不通过
        List<SaveModel> unPassList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"4");
        //其他原因取消
        List<SaveModel> otherList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"5");
        //总数
        if(totalList!=null && totalList.size()>0){
            rs.put("total",totalList.get(0).getResult2());
        }else{
            rs.put("total",0);
        }
        //进行中
        if(processingList!=null && processingList.size()>0){
            rs.put("processingCount",processingList.get(0).getResult2());
        }else {
            rs.put("processingCount", 0);
        }
        //已完成
        if(finishedList!=null && finishedList.size()>0){
            rs.put("finishCount",finishedList.get(0).getResult2());
        }else {
            rs.put("finishCount", 0);
        }
        //已取消
        if(canceledList!=null && canceledList.size()>0){
            rs.put("patientCancelCount",canceledList.get(0).getResult2());
        }else {
            rs.put("patientCancelCount", 0);
        }
        //审核不通过
        if(unPassList!=null && unPassList.size()>0){
            rs.put("noReviewedCount",unPassList.get(0).getResult2());
        }else {
            rs.put("noReviewedCount", 0);
        }
        //其他原因取消
        if(otherList!=null && otherList.size()>0){
            rs.put("payOuttimeCount",otherList.get(0).getResult2());
        }else {
            rs.put("payOuttimeCount", 0);
        }
        return rs;
    }
}

+ 17 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -9,6 +9,7 @@ import com.yihu.wlyy.util.ValueComparator;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.quota.vo.SaveModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -1589,4 +1590,20 @@ public class EsStatisticsController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    //=================================长处方分析===============================================
    @RequestMapping("/getPrescriptionCount")
    @ResponseBody
    @ApiOperation("订单统计-顶部总数获取")
    public String getPrescriptionCount(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                       @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,
                                       @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease){
        try{
            return write(200, "查询成功", "data", statisticsESService.getPrescriptionCount(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
}

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -1670,6 +1670,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getPrescriptionCount")
    @ResponseBody
    @ApiOperation("订单统计-顶部总数获取")
    @Deprecated
    public String getPrescriptionCount(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                       @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,
                                       @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease){