|
|
@@ -2,6 +2,8 @@ package com.nb.bus.stats.entity;
|
|
|
|
|
|
import com.nb.bus.service.dto.CombineEvalResult;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
/**
|
|
|
@@ -11,169 +13,169 @@ import java.util.HashMap;
|
|
|
* @Description TODO
|
|
|
* @createTime 2022年06月08日 22:40:00
|
|
|
*/
|
|
|
-public class EvalTableResult extends HashMap<String,Long> {
|
|
|
- public Long getStatics(){ return this.computeIfAbsent("静息疼痛",k->0L); }
|
|
|
+public class EvalTableResult extends HashMap<String, BigDecimal> {
|
|
|
+ public BigDecimal getStatics(){ return this.computeIfAbsent("静息疼痛",k->BigDecimal.ZERO); }
|
|
|
|
|
|
- public Long getActivity(){
|
|
|
- return this.computeIfAbsent("活动疼痛",k->0L);
|
|
|
+ public BigDecimal getActivity(){
|
|
|
+ return this.computeIfAbsent("活动疼痛",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getCalm(){
|
|
|
- return this.computeIfAbsent("镇静评分",k->0L);
|
|
|
+ public BigDecimal getCalm(){
|
|
|
+ return this.computeIfAbsent("镇静评分",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getLeftArm(){
|
|
|
- return this.computeIfAbsent("左上肢",k->0L);
|
|
|
+ public BigDecimal getLeftArm(){
|
|
|
+ return this.computeIfAbsent("左上肢",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getLeftLeg(){
|
|
|
- return this.computeIfAbsent("左下肢",k->0L);
|
|
|
+ public BigDecimal getLeftLeg(){
|
|
|
+ return this.computeIfAbsent("左下肢",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getRightArm(){
|
|
|
- return this.computeIfAbsent("右上肢",k->0L);
|
|
|
+ public BigDecimal getRightArm(){
|
|
|
+ return this.computeIfAbsent("右上肢",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getRightLeg(){
|
|
|
- return this.computeIfAbsent("右下肢",k->0L);
|
|
|
+ public BigDecimal getRightLeg(){
|
|
|
+ return this.computeIfAbsent("右下肢",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getNauseaVomit(){
|
|
|
- return this.computeIfAbsent("恶心呕吐",k->0L);
|
|
|
+ public BigDecimal getNauseaVomit(){
|
|
|
+ return this.computeIfAbsent("恶心呕吐",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getItch(){ return this.computeIfAbsent("瘙痒",k->0L); }
|
|
|
+ public BigDecimal getItch(){ return this.computeIfAbsent("瘙痒",k->BigDecimal.ZERO); }
|
|
|
|
|
|
- public Long getVertigo(){
|
|
|
- return this.computeIfAbsent("眩晕",k->0L);
|
|
|
+ public BigDecimal getVertigo(){
|
|
|
+ return this.computeIfAbsent("眩晕",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getSoreThroat(){
|
|
|
- return this.computeIfAbsent("咽喉疼痛",k->0L);
|
|
|
+ public BigDecimal getSoreThroat(){
|
|
|
+ return this.computeIfAbsent("咽喉疼痛",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getUroschesis(){
|
|
|
- return this.computeIfAbsent("尿潴留",k->0L);
|
|
|
+ public BigDecimal getUroschesis(){
|
|
|
+ return this.computeIfAbsent("尿潴留",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getBreathDepression(){
|
|
|
- return this.computeIfAbsent("呼吸抑制",k->0L);
|
|
|
+ public BigDecimal getBreathDepression(){
|
|
|
+ return this.computeIfAbsent("呼吸抑制",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getHoarseness(){
|
|
|
- return this.computeIfAbsent("声音嘶哑",k->0L);
|
|
|
+ public BigDecimal getHoarseness(){
|
|
|
+ return this.computeIfAbsent("声音嘶哑",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getCognitionObstacle(){
|
|
|
- return this.computeIfAbsent("认知障碍",k->0L);
|
|
|
+ public BigDecimal getCognitionObstacle(){
|
|
|
+ return this.computeIfAbsent("认知障碍",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getShrinkPressure(){
|
|
|
- return this.computeIfAbsent("收缩压",k->0L);
|
|
|
+ public BigDecimal getShrinkPressure(){
|
|
|
+ return this.computeIfAbsent("收缩压",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getDiastensPressure(){
|
|
|
- return this.computeIfAbsent("舒张压",k->0L);
|
|
|
+ public BigDecimal getDiastensPressure(){
|
|
|
+ return this.computeIfAbsent("舒张压",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getHeartRate(){
|
|
|
- return this.computeIfAbsent("心率",k->0L);
|
|
|
+ public BigDecimal getHeartRate(){
|
|
|
+ return this.computeIfAbsent("心率",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getFetalHeartRate(){
|
|
|
- return this.computeIfAbsent("胎心",k->0L);
|
|
|
+ public BigDecimal getFetalHeartRate(){
|
|
|
+ return this.computeIfAbsent("胎心",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getBreathRate(){
|
|
|
- return this.computeIfAbsent("呼吸频率",k->0L);
|
|
|
+ public BigDecimal getBreathRate(){
|
|
|
+ return this.computeIfAbsent("呼吸频率",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public Long getBloodOxygenSaturation(){
|
|
|
- return this.computeIfAbsent("血氧饱和度",k->0L);
|
|
|
+ public BigDecimal getBloodOxygenSaturation(){
|
|
|
+ return this.computeIfAbsent("血氧饱和度",k->BigDecimal.ZERO);
|
|
|
}
|
|
|
|
|
|
- public void incrementStatics() {
|
|
|
- incrementValue("静息疼痛");
|
|
|
+ public void incrementStatics(BigDecimal delta) {
|
|
|
+ incrementValue("静息疼痛",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementActivity() {
|
|
|
- incrementValue("活动疼痛");
|
|
|
+ public void incrementActivity(BigDecimal delta) {
|
|
|
+ incrementValue("活动疼痛",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementCalm() {
|
|
|
- incrementValue("镇静评分");
|
|
|
+ public void incrementCalm(BigDecimal delta) {
|
|
|
+ incrementValue("镇静评分",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementLeftArm() {
|
|
|
- incrementValue("左上肢");
|
|
|
+ public void incrementLeftArm(BigDecimal delta) {
|
|
|
+ incrementValue("左上肢",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementLeftLeg() {
|
|
|
- incrementValue("左下肢");
|
|
|
+ public void incrementLeftLeg(BigDecimal delta) {
|
|
|
+ incrementValue("左下肢",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementRightArm() {
|
|
|
- incrementValue("右上肢");
|
|
|
+ public void incrementRightArm(BigDecimal delta) {
|
|
|
+ incrementValue("右上肢",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementRightLeg() {
|
|
|
- incrementValue("右下肢");
|
|
|
+ public void incrementRightLeg(BigDecimal delta) {
|
|
|
+ incrementValue("右下肢",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementNauseaVomit() {
|
|
|
- incrementValue("恶心呕吐");
|
|
|
+ public void incrementNauseaVomit(BigDecimal delta) {
|
|
|
+ incrementValue("恶心呕吐",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementItch() {
|
|
|
- incrementValue("瘙痒");
|
|
|
+ public void incrementItch(BigDecimal delta) {
|
|
|
+ incrementValue("瘙痒",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementVertigo() {
|
|
|
- incrementValue("眩晕");
|
|
|
+ public void incrementVertigo(BigDecimal delta) {
|
|
|
+ incrementValue("眩晕",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementSoreThroat() {
|
|
|
- incrementValue("咽喉疼痛");
|
|
|
+ public void incrementSoreThroat(BigDecimal delta) {
|
|
|
+ incrementValue("咽喉疼痛",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementUroschesis() {
|
|
|
- incrementValue("尿潴留");
|
|
|
+ public void incrementUroschesis(BigDecimal delta) {
|
|
|
+ incrementValue("尿潴留",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementBreathDepression() {
|
|
|
- incrementValue("呼吸抑制");
|
|
|
+ public void incrementBreathDepression(BigDecimal delta) {
|
|
|
+ incrementValue("呼吸抑制",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementHoarseness() {
|
|
|
- incrementValue("声音嘶哑");
|
|
|
+ public void incrementHoarseness(BigDecimal delta) {
|
|
|
+ incrementValue("声音嘶哑",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementCognitionObstacle() {
|
|
|
- incrementValue("认知障碍");
|
|
|
+ public void incrementCognitionObstacle(BigDecimal delta) {
|
|
|
+ incrementValue("认知障碍",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementShrinkPressure() {
|
|
|
- incrementValue("收缩压");
|
|
|
+ public void incrementShrinkPressure(BigDecimal delta) {
|
|
|
+ incrementValue("收缩压",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementDiastensPressure() {
|
|
|
- incrementValue("舒张压");
|
|
|
+ public void incrementDiastensPressure(BigDecimal delta) {
|
|
|
+ incrementValue("舒张压",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementHeartRate() {
|
|
|
- incrementValue("心率");
|
|
|
+ public void incrementHeartRate(BigDecimal delta) {
|
|
|
+ incrementValue("心率",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementFetalHeartRate() {
|
|
|
- incrementValue("胎心");
|
|
|
+ public void incrementFetalHeartRate(BigDecimal delta) {
|
|
|
+ incrementValue("胎心",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementBreathRate() {
|
|
|
- incrementValue("呼吸频率");
|
|
|
+ public void incrementBreathRate(BigDecimal delta) {
|
|
|
+ incrementValue("呼吸频率",delta);
|
|
|
}
|
|
|
|
|
|
- public void incrementBloodOxygenSaturation() {
|
|
|
- incrementValue("血氧饱和度");
|
|
|
+ public void incrementBloodOxygenSaturation(BigDecimal delta) {
|
|
|
+ incrementValue("血氧饱和度",delta);
|
|
|
}
|
|
|
|
|
|
public EvalTableResult() {
|
|
|
@@ -200,73 +202,82 @@ public class EvalTableResult extends HashMap<String,Long> {
|
|
|
getBloodOxygenSaturation();
|
|
|
}
|
|
|
|
|
|
- private void incrementValue(String name){
|
|
|
- this.merge(name,1L,(t1,t2)->t1+t2);
|
|
|
+ private void incrementValue(String name,BigDecimal delta){
|
|
|
+ this.merge(name,delta,BigDecimal::add);
|
|
|
}
|
|
|
|
|
|
public void handle(CombineEvalResult evalResult) {
|
|
|
if(evalResult.getStatics()!=null){
|
|
|
- incrementStatics();
|
|
|
+ incrementStatics(BigDecimal.valueOf(evalResult.getStatics()));
|
|
|
}
|
|
|
if(evalResult.getActivity()!=null){
|
|
|
- incrementActivity();
|
|
|
+ incrementActivity(BigDecimal.valueOf(evalResult.getActivity()));
|
|
|
}
|
|
|
if(evalResult.getCalm()!=null){
|
|
|
- incrementCalm();
|
|
|
+ incrementCalm(BigDecimal.valueOf(evalResult.getCalm()));
|
|
|
}
|
|
|
if(evalResult.getLeftArm()!=null){
|
|
|
- incrementLeftArm();
|
|
|
+ incrementLeftArm(BigDecimal.valueOf(evalResult.getLeftArm()));
|
|
|
}
|
|
|
if(evalResult.getLeftLeg()!=null){
|
|
|
- incrementLeftLeg();
|
|
|
+ incrementLeftLeg(BigDecimal.valueOf(evalResult.getLeftLeg()));
|
|
|
}
|
|
|
if(evalResult.getRightArm()!=null){
|
|
|
- incrementRightArm();
|
|
|
+ incrementRightArm(BigDecimal.valueOf(evalResult.getRightArm()));
|
|
|
}
|
|
|
if(evalResult.getRightLeg()!=null){
|
|
|
- incrementRightLeg();
|
|
|
+ incrementRightLeg(BigDecimal.valueOf(evalResult.getRightLeg()));
|
|
|
}
|
|
|
if(evalResult.getNauseaVomit()!=null){
|
|
|
- incrementNauseaVomit();
|
|
|
+ incrementNauseaVomit(BigDecimal.valueOf(evalResult.getNauseaVomit()));
|
|
|
}
|
|
|
if(evalResult.getItch()!=null){
|
|
|
- incrementItch();
|
|
|
+ incrementItch(BigDecimal.valueOf(evalResult.getItch()));
|
|
|
}
|
|
|
if(evalResult.getVertigo()!=null){
|
|
|
- incrementVertigo();
|
|
|
+ incrementVertigo(BigDecimal.valueOf(evalResult.getVertigo()));
|
|
|
}
|
|
|
if(evalResult.getSoreThroat()!=null){
|
|
|
- incrementSoreThroat();
|
|
|
+ incrementSoreThroat(BigDecimal.valueOf(evalResult.getSoreThroat()));
|
|
|
}
|
|
|
if(evalResult.getUroschesis()!=null){
|
|
|
- incrementUroschesis();
|
|
|
+ incrementUroschesis(BigDecimal.valueOf(evalResult.getUroschesis()));
|
|
|
}
|
|
|
if(evalResult.getBreathDepression()!=null){
|
|
|
- incrementBreathDepression();
|
|
|
+ incrementBreathDepression(BigDecimal.valueOf(evalResult.getBreathDepression()));
|
|
|
}
|
|
|
if(evalResult.getHoarseness()!=null){
|
|
|
- incrementHoarseness();
|
|
|
+ incrementHoarseness(BigDecimal.valueOf(evalResult.getHoarseness()));
|
|
|
}
|
|
|
if(evalResult.getCognitionObstacle()!=null){
|
|
|
- incrementCognitionObstacle();
|
|
|
+ incrementCognitionObstacle(BigDecimal.valueOf(evalResult.getCognitionObstacle()));
|
|
|
}
|
|
|
if(evalResult.getShrinkPressure()!=null){
|
|
|
- incrementShrinkPressure();
|
|
|
+ incrementShrinkPressure(evalResult.getShrinkPressure());
|
|
|
}
|
|
|
if(evalResult.getDiastensPressure()!=null){
|
|
|
- incrementDiastensPressure();
|
|
|
+ incrementDiastensPressure(evalResult.getDiastensPressure());
|
|
|
}
|
|
|
if(evalResult.getHeartRate()!=null){
|
|
|
- incrementHeartRate();
|
|
|
+ incrementHeartRate(evalResult.getHeartRate());
|
|
|
}
|
|
|
if(evalResult.getFetalHeartRate()!=null){
|
|
|
- incrementFetalHeartRate();
|
|
|
+ incrementFetalHeartRate(evalResult.getFetalHeartRate());
|
|
|
}
|
|
|
if(evalResult.getBreathRate()!=null){
|
|
|
- incrementBreathRate();
|
|
|
+ incrementBreathRate(evalResult.getBreathRate());
|
|
|
}
|
|
|
if(evalResult.getBloodOxygenSaturation()!=null){
|
|
|
- incrementBloodOxygenSaturation();
|
|
|
+ incrementBloodOxygenSaturation(evalResult.getBloodOxygenSaturation());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void computeAvg(BigDecimal total){
|
|
|
+ if(BigDecimal.ZERO.equals(total)||BigDecimal.ONE.equals(total)){
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ this.forEach((k,v)->{
|
|
|
+ v=v.divide(total,4, RoundingMode.HALF_UP);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|