Prechádzať zdrojové kódy

完整性、及时性、准确性趋势性能优化

zhengwei 6 rokov pred
rodič
commit
56df3bcde1

+ 5 - 5
src/main/java/com/yihu/ehr/analyze/service/dataQuality/DataCompleteService.java

@ -91,13 +91,13 @@ public class DataCompleteService extends DataQualityBaseService {
    @Override
    public List<Map<String, Object>> getOrgDataQuality(Integer dataLevel, String areaCode, String startDate, String endDate) throws Exception {
        String end = DateUtil.addDate(1, endDate, DateUtil.DEFAULT_DATE_YMD_FORMAT);
        //String end = DateUtil.addDate(1, endDate, DateUtil.DEFAULT_DATE_YMD_FORMAT);
        Map<String, Object> resMap = null;
        List<Map<String, Object>> list = new ArrayList<>();
        double totalNum = 0;//平台总数
        double totalHospitalNum = 0;//医院总数
        //机构数据
        List<Map<String, Object>> groupList = dataCorrectService.getOrgDataMap(dataLevel, "event_date", startDate, end, areaCode);
        List<Map<String, Object>> groupList = dataCorrectService.getOrgDataMap(dataLevel, "event_date", startDate, endDate, areaCode);
        //平台接收数据量
        Map<String, Object> platformDataGroup = getPlatformDataGroup(dataLevel, "event_date", startDate, endDate, areaCode);
        // 计算
@ -167,17 +167,17 @@ public class DataCompleteService extends DataQualityBaseService {
            //添加标识,标识是机构数据
            resMap.put("type", "org_code");
            fields.add("org_code");
            sql1 = "SELECT count(DISTINCT profile_id) as count ,org_code FROM json_archives/info where pack_type=1 and analyze_status=3 and org_area='" + orgArea + "' and " +
            sql1 = "SELECT count(DISTINCT event_no) as count ,org_code FROM json_archives/info where pack_type=1 and analyze_status=3 and org_area='" + orgArea + "' and " +
                    dateField + ">='" + start + " 00:00:00' and " + dateField + "<='" + end + " 23:59:59' group by org_code";
        } else if (StringUtils.isEmpty(orgArea) && (dataLevel == 0 && StringUtils.isEmpty(orgArea))) {
            resMap.put("type", "org_area");
            fields.add("org_area");
            sql1 = "SELECT count(DISTINCT profile_id) as count ,org_area FROM json_archives/info  where pack_type=1 and analyze_status=3 and " +
            sql1 = "SELECT count(DISTINCT event_no) as count ,org_area FROM json_archives/info  where pack_type=1 and analyze_status=3 and " +
                    dateField + ">='" + start + " 00:00:00' and " + dateField + "<='" + end + " 23:59:59' group by org_area";
        } else if (StringUtils.isEmpty(orgArea) && (dataLevel == 1 && StringUtils.isEmpty(orgArea))) {
            resMap.put("type", "org_code");
            fields.add("org_code");
            sql1 = "SELECT count(DISTINCT profile_id) as count ,org_code FROM json_archives/info  where pack_type=1 and analyze_status=3 and " +
            sql1 = "SELECT count(DISTINCT event_no) as count ,org_code FROM json_archives/info  where pack_type=1 and analyze_status=3 and " +
                    dateField + ">='" + start + " 00:00:00' and " + dateField + "<='" + end + " 23:59:59' group by org_code";
        }

+ 5 - 5
src/main/java/com/yihu/ehr/analyze/service/dataQuality/DataCorrectService.java

@ -297,7 +297,7 @@ public class DataCorrectService extends DataQualityBaseService {
    @Override
    public List<Map<String, Object>> getOrgDataQuality(Integer dataLevel,String areaCode, String startDate, String endDate) throws Exception {
        String end = DateUtil.addDate(1, endDate,DateUtil.DEFAULT_DATE_YMD_FORMAT);
        //String end = DateUtil.addDate(1, endDate,DateUtil.DEFAULT_DATE_YMD_FORMAT);
        Map<String,Object> resMap = null;
        List<Map<String,Object>> list = new ArrayList<>();
        double totalNum = 0;//平台总数
@ -305,7 +305,7 @@ public class DataCorrectService extends DataQualityBaseService {
        //机构数据
//        List<Map<String,Object>> groupList = getOrgDataMap(dataLevel,"create_date",startDate,end,areaCode);
        //准确性算法,由于之前算法依赖到  医院总数据量,   医院数据量经常未做上报,导致数据问题,先改成 根据接收总数计算
        List<Map<String,Object>> groupList = getReceiveMap(dataLevel,startDate,end,areaCode);
        List<Map<String,Object>> groupList = getReceiveMap(dataLevel,startDate,endDate,areaCode);
        //平台接收数据量
        Map<String, Object> platformDataGroup = getErrorPlatformData(dataLevel,"event_date",startDate, endDate,areaCode);
        // 计算
@ -375,15 +375,15 @@ public class DataCorrectService extends DataQualityBaseService {
            String sql1 = "";
            if (StringUtils.isNotEmpty(orgArea)) {
                fields.add("org_code");
                sql1 = "SELECT org_code,count(distinct profile_id) as count from json_archives where org_area='" + orgArea + "' and event_date>='" + start + "' and event_date<='" + end + "' group by org_code";
                sql1 = "SELECT org_code,count(distinct event_no) as count from json_archives where org_area='" + orgArea + "' and event_date>='" + start + "' and event_date<='" + end + "' group by org_code";
            } else {
                if (dataLevel == 0) {
                    fields.add("org_area");
                    sql1 = "SELECT org_area,count(distinct profile_id) as count from json_archives where " +
                    sql1 = "SELECT org_area,count(distinct event_no) as count from json_archives where " +
                            "event_date >='" + start + "' and event_date <='" + end + "' group by org_area";
                }else {
                    fields.add("org_code");
                    sql1 = "SELECT org_code,count(distinct profile_id) as count from json_archives where " +
                    sql1 = "SELECT org_code,count(distinct event_no) as count from json_archives where " +
                            "event_date >='" + start + "' and event_date <='" + end + "' group by org_code";
                }

+ 2 - 2
src/main/java/com/yihu/ehr/analyze/service/dataQuality/DataInTimeService.java

@ -189,13 +189,13 @@ public class DataInTimeService extends DataQualityBaseService {
    @Override
    public List<Map<String, Object>> getOrgDataQuality(Integer dataLevel, String areaCode, String startDate, String endDate) throws Exception {
        String end = DateUtil.addDate(1, endDate, DateUtil.DEFAULT_DATE_YMD_FORMAT);
        //String end = DateUtil.addDate(1, endDate, DateUtil.DEFAULT_DATE_YMD_FORMAT);
        Map<String, Object> resMap = null;
        List<Map<String, Object>> list = new ArrayList<>();
        double totalNum = 0;//平台总数
        double totalHospitalNum = 0;//医院总数
        //机构数据
        List<Map<String, Object>> groupList = dataCorrectService.getOrgDataMap(dataLevel, "event_date", startDate, end, areaCode);
        List<Map<String, Object>> groupList = dataCorrectService.getOrgDataMap(dataLevel, "event_date", startDate, endDate, areaCode);
        //平台接收数据量
        Map<String, Object> platformDataGroup = getInTimeDataMap(dataLevel, "event_date", startDate, endDate, areaCode);
        // 计算