Commit 5c2d156310aecc1df3a92d290bcf1f356275c90d
1 parent
53b69f2940
Exists in
master
and in
6 other branches
高危因数统计自定义高危统计bug
Showing 2 changed files with 23 additions and 3 deletions
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
5c2d156
... | ... | @@ -461,7 +461,10 @@ |
461 | 461 | |
462 | 462 | private boolean norFactor; |
463 | 463 | |
464 | + //国家高危因数为空集合 | |
465 | + private boolean isNullrFactor; | |
464 | 466 | |
467 | + | |
465 | 468 | /** |
466 | 469 | * 是否有效 |
467 | 470 | */ |
... | ... | @@ -532,6 +535,14 @@ |
532 | 535 | //孕妇证件类型 |
533 | 536 | private String pcerteTypeId; |
534 | 537 | |
538 | + public boolean isNullrFactor() { | |
539 | + return isNullrFactor; | |
540 | + } | |
541 | + | |
542 | + public void setNullrFactor(boolean nullrFactor) { | |
543 | + isNullrFactor = nullrFactor; | |
544 | + } | |
545 | + | |
535 | 546 | public String getPcerteTypeId() { |
536 | 547 | return pcerteTypeId; |
537 | 548 | } |
... | ... | @@ -1344,6 +1355,11 @@ |
1344 | 1355 | } else if (null != rFactorList && !rFactorList.isEmpty()) { |
1345 | 1356 | condition = condition.and("riskFactorId", rFactorList, MongoOper.IN); |
1346 | 1357 | } |
1358 | + | |
1359 | + if(isNullrFactor){ | |
1360 | + condition = condition.and("riskFactorId", new ArrayList<String>(), MongoOper.IS); | |
1361 | + } | |
1362 | + | |
1347 | 1363 | if (-1 != yn) { |
1348 | 1364 | condition = condition.and("yn", yn, MongoOper.IS); |
1349 | 1365 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
5c2d156
... | ... | @@ -154,10 +154,14 @@ |
154 | 154 | query.setBookbuildingDateEnd(patientsQuery.getBookbuildingDateEnd()); |
155 | 155 | query.setNotoRiskFactor(""); |
156 | 156 | query.setoRiskFactor("true"); |
157 | + query.setNullrFactor(true); | |
157 | 158 | query.setType(patientsQuery.getType()); |
158 | 159 | |
159 | - //单个高危因素孕产妇条数(自定义高危) | |
160 | + //不包含国家高危的自定义高危人数 | |
160 | 161 | int riskPatientCount = patientsService.queryPatientCount(query); |
162 | + query.setNullrFactor(false); | |
163 | + //包含国家高危的自定义高危人数 | |
164 | + int otherPatientCount = patientsService.queryPatientCount(query); | |
161 | 165 | |
162 | 166 | //总的孕妇条数(国家标准高危) |
163 | 167 | int allPatientCount = patientsService.queryPatientCount(patientsQuery); |
... | ... | @@ -216,7 +220,7 @@ |
216 | 220 | } |
217 | 221 | } |
218 | 222 | |
219 | - results.addAll(getOtherRiskCount(riskPatientCount, allPatientCount)); | |
223 | + results.addAll(getOtherRiskCount(otherPatientCount, allPatientCount+riskPatientCount)); | |
220 | 224 | // Collections.sort(results, new RiskReportResult()); |
221 | 225 | Map<String, List<RiskReportResult>> slaveBasicConfigMap = new HashMap<>(); |
222 | 226 | for (RiskReportResult bc : results) { |
... | ... | @@ -278,7 +282,7 @@ |
278 | 282 | |
279 | 283 | DecimalFormat df = new DecimalFormat("0.00"); |
280 | 284 | //肖进:其他高危发病率=其他高危+国家高危人数/其他高危人数 |
281 | - String percent =riskPatientCount>0? df.format((double) riskPatientCount / (allPatientCount+riskPatientCount) * 100) + "%":"0%"; | |
285 | + String percent =riskPatientCount>0? df.format((double) riskPatientCount / (allPatientCount) * 100) + "%":"0%"; | |
282 | 286 | risk.setPercent(percent); |
283 | 287 | |
284 | 288 | List level = new ArrayList(); |