|
@@ -43,15 +43,15 @@ public class LISViewRepository {
|
|
|
public String query(Integer QIIndex,String dateRange) {
|
|
public String query(Integer QIIndex,String dateRange) {
|
|
|
String StartDate = dateRange.substring(0,10)+" 00:00:00";
|
|
String StartDate = dateRange.substring(0,10)+" 00:00:00";
|
|
|
String EndDate = dateRange.substring(11)+" 23:59:59";
|
|
String EndDate = dateRange.substring(11)+" 23:59:59";
|
|
|
|
|
+ String StartDate2 = dateRange.substring(0,10).replace("-","");
|
|
|
|
|
+ String EndDate2 = dateRange.substring(11).replace("-","");
|
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
|
|
|
|
|
if (QIIndex != null) {
|
|
if (QIIndex != null) {
|
|
|
- //总标本不合格率
|
|
|
|
|
|
|
+ //总标本不合格率--已修正
|
|
|
if (QIIndex == 0) {
|
|
if (QIIndex == 0) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM" +
|
|
|
|
|
- "(SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct t.SampleBarCode) from v_jt_lisrequest t where t.sampletime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -62,9 +62,7 @@ public class LISViewRepository {
|
|
|
//抗凝标本凝集率
|
|
//抗凝标本凝集率
|
|
|
if (QIIndex == 1) {
|
|
if (QIIndex == 1) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount*1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE REJECTREASONCODE='02' and RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE sampletypeid='00' and RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount*1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where t.RejectReasonName like '%抗凝%' and t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct SampleBarCode) from v_jt_lisxknrequest where SAMPLETIME between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -72,12 +70,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //标本类型错误率
|
|
|
|
|
|
|
+ //标本类型错误率--已修正
|
|
|
if (QIIndex == 2) {
|
|
if (QIIndex == 2) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE REJECTREASONCODE in ('3','2','15') and RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where (t.RejectReasonName like '%标本类型错误%' or t.RejectReasonName like '%样本类型错误%') and t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct t.SampleBarCode) from v_jt_lisrequest t where t.sampletime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -85,12 +81,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //标本容器错误率
|
|
|
|
|
|
|
+ //标本容器错误率--已修正
|
|
|
if (QIIndex == 3) {
|
|
if (QIIndex == 3) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE REJECTREASONCODE in ('20','1') and RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where t.RejectReasonName like '%样本容器错误%' and t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct t.SampleBarCode) from v_jt_lisrequest t where t.sampletime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -98,12 +92,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //标本溶血率
|
|
|
|
|
|
|
+ //标本溶血率--已修正
|
|
|
if (QIIndex == 4) {
|
|
if (QIIndex == 4) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE REJECTREASONCODE='01' and RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where t.RejectReasonName like '%溶血%' and t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct t.SampleBarCode) from v_jt_lisrequest t where t.sampletime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -111,12 +103,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //标本采集量错误率
|
|
|
|
|
|
|
+ //标本采集量错误率--已修正
|
|
|
if (QIIndex == 5) {
|
|
if (QIIndex == 5) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE REJECTREASONCODE in ('03','031') and RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where t.RejectReasonName like '%标本采集量错误%' and t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct t.SampleBarCode) from v_jt_lisrequest t where t.sampletime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -124,11 +114,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //急诊常规实验室内TAT中位数
|
|
|
|
|
|
|
+ //急诊常规实验室内TAT中位数--已修正
|
|
|
if (QIIndex == 6) {
|
|
if (QIIndex == 6) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT MEDIAN(c.INTAT) AS RESULTVALUE, MAX(d.TOTAL_COUNT) AS Total FROM V_JT_TAT c INNER JOIN (SELECT b.SAMPLEID,COUNT(*) OVER() AS TOTAL_COUNT FROM V_JT_LISREQUEST a INNER JOIN V_JT_LISREPORT b ON a.SAMPLEID = b.SAMPLEID " +
|
|
|
|
|
- "WHERE b.INSTRUMENTGROUPCODE IN ('CG_BloodLAS','CG_UristLAS3','CG_XD6001','USF3000','CG_FA280S','CG_BC5390','CG_FA280S2') AND a.RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) d ON c.SAMPLEID = d.SAMPLEID";
|
|
|
|
|
|
|
+ String sqlQry = "select MEDIAN(INTAT) as RESULTVALUE,COUNT(*) AS Total from v_jt_lisreport t where t.testdate >= '"+StartDate2+"' and t.testdate <= '"+EndDate2+"' and REPORTTYPE in('急诊血常规','急诊粪便常规','急诊尿常规')";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -136,11 +125,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getTotal();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getTotal();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //急诊生化免疫实验室内TAT中位数
|
|
|
|
|
|
|
+ //急诊生化免疫实验室内TAT中位数--已修正
|
|
|
if (QIIndex == 7) {
|
|
if (QIIndex == 7) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT MEDIAN(c.INTAT) AS RESULTVALUE, MAX(d.TOTAL_COUNT) AS Total FROM V_JT_TAT c INNER JOIN (SELECT b.SAMPLEID,COUNT(*) OVER() AS TOTAL_COUNT FROM V_JT_LISREQUEST a INNER JOIN V_JT_LISREPORT b ON a.SAMPLEID = b.SAMPLEID " +
|
|
|
|
|
- "WHERE b.INSTRUMENTGROUPCODE='Abbott_IM_LAS_1' AND a.RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) d ON c.SAMPLEID = d.SAMPLEID";
|
|
|
|
|
|
|
+ String sqlQry = "select MEDIAN(INTAT) as RESULTVALUE,COUNT(*) AS Total from v_jt_lisreport t where t.testdate >= '"+StartDate2+"' and t.testdate <= '"+EndDate2+"' and REPORTTYPE = '急诊生化免疫'";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -148,11 +136,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getTotal();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getTotal();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //急诊凝血实验室内TAT中位数
|
|
|
|
|
|
|
+ //急诊凝血实验室内TAT中位数--已修正
|
|
|
if (QIIndex == 8) {
|
|
if (QIIndex == 8) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT MEDIAN(c.INTAT) AS RESULTVALUE, MAX(d.TOTAL_COUNT) AS Total FROM V_JT_TAT c INNER JOIN (SELECT b.SAMPLEID,COUNT(*) OVER() AS TOTAL_COUNT FROM V_JT_LISREQUEST a INNER JOIN V_JT_LISREPORT b ON a.SAMPLEID = b.SAMPLEID " +
|
|
|
|
|
- "WHERE b.INSTRUMENTGROUPCODE='CG_StagoCompact' AND a.RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) d ON c.SAMPLEID = d.SAMPLEID";
|
|
|
|
|
|
|
+ String sqlQry = "select MEDIAN(INTAT) as RESULTVALUE,COUNT(*) AS Total from v_jt_lisreport t where t.testdate >= '"+StartDate2+"' and t.testdate <= '"+EndDate2+"' and REPORTTYPE = '急诊凝血'";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -160,11 +147,10 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getTotal();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getTotal();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //急诊血常规检验前周转时间中位数
|
|
|
|
|
|
|
+ //急诊血常规检验前周转时间中位数--已修正
|
|
|
if (QIIndex == 9) {
|
|
if (QIIndex == 9) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT MEDIAN(c.PRETAT) AS RESULTVALUE, MAX(d.TOTAL_COUNT) AS Total FROM V_JT_TAT c INNER JOIN (SELECT b.SAMPLEID,COUNT(*) OVER() AS TOTAL_COUNT FROM V_JT_LISREQUEST a INNER JOIN V_JT_LISREPORT b ON a.SAMPLEID = b.SAMPLEID " +
|
|
|
|
|
- "WHERE b.INSTRUMENTGROUPCODE in ('CG_BloodLAS','CG_BC5390') AND a.RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) d ON c.SAMPLEID = d.SAMPLEID";
|
|
|
|
|
|
|
+ String sqlQry = "select MEDIAN(PRETAT) as RESULTVALUE,COUNT(*) AS Total from v_jt_lisreport t where t.testdate >= '"+StartDate2+"' and t.testdate <= '"+EndDate2+"' and REPORTTYPE = '急诊血常规'";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -175,8 +161,7 @@ public class LISViewRepository {
|
|
|
//急诊血常规实验室内周转时间中位数
|
|
//急诊血常规实验室内周转时间中位数
|
|
|
if (QIIndex == 10) {
|
|
if (QIIndex == 10) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT MEDIAN(c.INTAT) AS RESULTVALUE, MAX(d.TOTAL_COUNT) AS Total FROM V_JT_TAT c INNER JOIN (SELECT b.SAMPLEID,COUNT(*) OVER() AS TOTAL_COUNT FROM V_JT_LISREQUEST a INNER JOIN V_JT_LISREPORT b ON a.SAMPLEID = b.SAMPLEID " +
|
|
|
|
|
- "WHERE b.INSTRUMENTGROUPCODE in ('CG_BloodLAS','CG_BC5390') AND a.RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) d ON c.SAMPLEID = d.SAMPLEID";
|
|
|
|
|
|
|
+ String sqlQry = "select MEDIAN(INTAT) as RESULTVALUE,COUNT(*) AS Total from v_jt_lisreport t where t.testdate >= '"+StartDate2+"' and t.testdate <= '"+EndDate2+"' and REPORTTYPE = '急诊血常规'";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -186,12 +171,10 @@ public class LISViewRepository {
|
|
|
|
|
|
|
|
//常规检验报告发放TAT时间符合率
|
|
//常规检验报告发放TAT时间符合率
|
|
|
|
|
|
|
|
- //检验报告不正确率+
|
|
|
|
|
|
|
+ //检验报告不正确率--已修正
|
|
|
if (QIIndex == 12) {
|
|
if (QIIndex == 12) {
|
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((CancelCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,CancelCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM V_JT_LISCANCELREPORT WHERE GROUPID in ('30','06','05','00','31','07') and CANCELAUDITREASON like '%不正确%' and CANCELAUDITTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS CancelCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisreport WHERE GROUPID in ('30','06','05','00','31','07') and AUDITTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((CancelCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,CancelCount as Numerator,AllCount as Denominator FROM (SELECT (select count(1) from V_JT_LISCANCELREPORT t where t.CancelAuditReason like '%不正确%' and t.CancelAuditTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS CancelCount,(select count(1) from v_jt_lisreport t where t.testdate between '"+StartDate2+"' and '"+EndDate2+"') AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -199,39 +182,34 @@ public class LISViewRepository {
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //危急值通报率
|
|
|
|
|
|
|
+ //危急值通报率--已修正
|
|
|
if (QIIndex == 13) {
|
|
if (QIIndex == 13) {
|
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
//String sqlQry = "select count(*) as ResultValue from v_jt_lisrequest where SampleTime between ? and ?";
|
|
//String sqlQry = "select count(*) as ResultValue from v_jt_lisrequest where SampleTime between ? and ?";
|
|
|
// String sqlQry = "SELECT ROUND((COUNT(CASE WHEN ReceiverFlag = '1' THEN 1 END)/COUNT(*))*100,2) AS ResultValue FROM V_JT_CRITICAL where BUILDCRISISTIME between TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')";
|
|
// String sqlQry = "SELECT ROUND((COUNT(CASE WHEN ReceiverFlag = '1' THEN 1 END)/COUNT(*))*100,2) AS ResultValue FROM V_JT_CRITICAL where BUILDCRISISTIME between TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')";
|
|
|
- String sqlQry = "SELECT ROUND((COUNT(CASE WHEN ReceiverFlag = '1' THEN 1 END)/COUNT(*))*100, 2) AS ResultValue,COUNT(CASE WHEN ReceiverFlag = '1' THEN 1 END) AS Numerator,COUNT(*) AS Denominator "+
|
|
|
|
|
- "FROM V_JT_CRITICAL WHERE BUILDCRISISTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS') and groupid in ('00','06','31','30')";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT ROUND(CASE WHEN COUNT(1) = 0 THEN 0 ELSE CAST(COUNT(t.FeedBackTime) AS NUMBER) / COUNT(1) *100 END,4) AS ResultValue,COUNT(t.FeedBackTime) AS Numerator,COUNT(1) AS Denominator FROM V_JT_CRITICAL t WHERE t.SendCrisisTime >= TO_DATE('"+StartDate+"', 'yyyy-mm-dd hh24:mi:ss') AND t.SendCrisisTime <= TO_DATE('"+EndDate+"', 'yyyy-mm-dd hh24:mi:ss')";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //危急值通报及时率
|
|
|
|
|
|
|
+ //危急值通报及时率--已修正
|
|
|
if (QIIndex == 14) {
|
|
if (QIIndex == 14) {
|
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
//String sqlQry = "select count(*) as ResultValue from v_jt_lisrequest where SampleTime between ? and ?";
|
|
//String sqlQry = "select count(*) as ResultValue from v_jt_lisrequest where SampleTime between ? and ?";
|
|
|
- String sqlQry = "SELECT ROUND(COUNT(CASE WHEN (SENDCRISISTIME - BUILDCRISISTIME) * 24 * 60 <= 30 THEN 1 END) / COUNT(*) * 100, 2) || '%' AS ResultValue,"+
|
|
|
|
|
- "COUNT(CASE WHEN (SENDCRISISTIME - BUILDCRISISTIME) * 24 * 60 <= 30 THEN 1 END) AS Numerator,COUNT(*) AS Denominator FROM V_JT_CRITICAL WHERE "+
|
|
|
|
|
- "BUILDCRISISTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS') AND GROUPID IN ('00', '31', '30') ";
|
|
|
|
|
- log.info("excute sql:"+sqlQry);
|
|
|
|
|
|
|
+ String sqlQry = "SELECT ROUND(CASE WHEN COUNT(1) = 0 THEN 0 ELSE CAST(SUM(CASE WHEN t.AccordFlag = '1' THEN 1 ELSE 0 END) AS NUMBER) / COUNT(1) *100 END, 4) AS ResultValue, SUM(CASE WHEN t.AccordFlag = '1' THEN 1 ELSE 0 END) AS Numerator, COUNT(1) AS Denominator FROM V_JT_CRITICAL t WHERE t.SendCrisisTime between TO_DATE('"+StartDate+"', 'yyyy-mm-dd hh24:mi:ss') AND TO_DATE('"+EndDate+"', 'yyyy-mm-dd hh24:mi:ss')";
|
|
|
|
|
+ log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
|
//System.out.println(lvList.get(0).getResultValue());
|
|
//System.out.println(lvList.get(0).getResultValue());
|
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
return lvList.get(0).getResultValue()+"^"+lvList.get(0).getNumerator()+"^"+lvList.get(0).getDenominator();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //标本合格率
|
|
|
|
|
|
|
+ //标本合格率--已修正
|
|
|
if (QIIndex == 15) {
|
|
if (QIIndex == 15) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM " +
|
|
|
|
|
- "(SELECT (SELECT COUNT(*) FROM v_jt_reject_sample WHERE RejectTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS RejectCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisrequest WHERE RegisterTime BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((RejectCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,RejectCount as Numerator,AllCount as Denominator FROM (SELECT (select count(distinct t.SampleBarCode) from V_JT_REJECT_SAMPLE t where t.RejectTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS RejectCount,(select count(distinct t.SampleBarCode) from v_jt_lisrequest t where t.sampletime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -254,9 +232,7 @@ public class LISViewRepository {
|
|
|
//报告准确率
|
|
//报告准确率
|
|
|
if (QIIndex == 17) {
|
|
if (QIIndex == 17) {
|
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
//System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
- String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((CancelCount * 1.0/AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,CancelCount as Numerator,AllCount as Denominator FROM (" +
|
|
|
|
|
- "SELECT (SELECT COUNT(*) FROM V_JT_LISCANCELREPORT WHERE CANCELAUDITTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS CancelCount," +
|
|
|
|
|
- "(SELECT COUNT(*) FROM v_jt_lisreport WHERE AUDITTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')) AS AllCount FROM DUAL) Counts";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT CASE WHEN AllCount = 0 THEN -1 ELSE CAST((CancelCount * 1.0 / AllCount)*100 AS DECIMAL(20,4)) END AS ResultValue,CancelCount as Numerator,AllCount as Denominator FROM (SELECT (select count(1) from V_JT_LISCANCELREPORT t where t.CancelAuditReason like '%不正确%' and t.CancelAuditTime between to_date('"+StartDate+"','yyyy-mm-dd hh24:mi:ss') and to_date('"+EndDate+"','yyyy-mm-dd hh24:mi:ss')) AS CancelCount,(select count(1) from v_jt_lisreport t where t.testdate between '"+StartDate2+"' and '"+EndDate2+"') AS AllCount FROM DUAL) Counts";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
@@ -276,12 +252,11 @@ public class LISViewRepository {
|
|
|
return String.join("^", String.valueOf(resultValue), String.valueOf(newNumeratorValue), denominatorStr);
|
|
return String.join("^", String.valueOf(resultValue), String.valueOf(newNumeratorValue), denominatorStr);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //危急值通报符合率
|
|
|
|
|
|
|
+ //危急值通报符合率--已修正
|
|
|
if (QIIndex == 18) {
|
|
if (QIIndex == 18) {
|
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
// System.out.println("dateRange:"+dateRange+",StartDate:"+StartDate+",EndDate:"+EndDate);
|
|
|
//String sqlQry = "select count(*) as ResultValue from v_jt_lisrequest where SampleTime between ? and ?";
|
|
//String sqlQry = "select count(*) as ResultValue from v_jt_lisrequest where SampleTime between ? and ?";
|
|
|
- String sqlQry = "SELECT ROUND((COUNT(CASE WHEN AccordFlag = '1' THEN 1 END)/COUNT(*))*100, 2) AS ResultValue, COUNT(CASE WHEN AccordFlag = '1' THEN 1 END) AS Numerator,COUNT(*) AS Denominator FROM " +
|
|
|
|
|
- "V_JT_CRITICAL WHERE BUILDCRISISTIME BETWEEN TO_DATE('"+StartDate+"', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('"+EndDate+"', 'YYYY-MM-DD HH24:MI:SS')";
|
|
|
|
|
|
|
+ String sqlQry = "SELECT ROUND(CASE WHEN COUNT(1) = 0 THEN 0 ELSE CAST(SUM(CASE WHEN t.AccordFlag = '1' THEN 1 ELSE 0 END) AS NUMBER) / COUNT(1) * 100 END, 4) AS ResultValue, SUM(CASE WHEN t.AccordFlag = '1' THEN 1 ELSE 0 END) AS Numerator, COUNT(1) AS Denominator FROM V_JT_CRITICAL t WHERE t.SendCrisisTime between TO_DATE('"+StartDate+"', 'yyyy-mm-dd hh24:mi:ss') AND TO_DATE('"+EndDate+"', 'yyyy-mm-dd hh24:mi:ss')";
|
|
|
log.info("excute sql:"+sqlQry);
|
|
log.info("excute sql:"+sqlQry);
|
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
RowMapper<LISView> infoRowMapper = new BeanPropertyRowMapper<>(LISView.class);
|
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|
|
List<LISView> lvList = jdbcTemplate.query(sqlQry, infoRowMapper);
|