diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java index 9578cde..0b53ddd 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java @@ -42,6 +42,7 @@ import org.springframework.stereotype.Service; import scala.Int; import scala.util.parsing.combinator.testing.Str; +import javax.swing.text.html.parser.Entity; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; @@ -2053,42 +2054,110 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient weights.put(DateUtil.getWeek2(patients.getLastMenses(), DateUtil.parseYMD(entry.getKey())), entry.getValue()); } } - for (String reis : reiskFactor) { - for (WeightReportModel weightReportModel : weightReport) { + for (WeightReportModel weightReportModel : weightReport) { + for (String reis : reiskFactor) { if (reis.equals(weightReportModel.getgDMId()) || reis.equals(weightReportModel.getoDIPId()) || reis.equals(weightReportModel.getMedicationDiabetesID())) { //糖尿病diabetes - datas.put("1", this.getDiabetestInfo(weights, data3, weightReportModel, patientWeight, patients, bmiD, week, diabetesKcalStr)); + Set set = new HashSet(); + if (null != weightReportModel.getgDMId()) { + set.add(weightReportModel.getgDMName()); + } + if (null != weightReportModel.getMedicationDiabetesID()) { + set.add(weightReportModel.getoDIPName()); + } + datas.put("1", this.getDiabetestInfo(weights, data3, weightReportModel, patientWeight, patients, bmiD, week, diabetesKcalStr, set)); } else if (reis.equals(weightReportModel.getGestationalHypertensionGHID()) || reis.equals(weightReportModel.getChronicHypertensionID())) { + Set set = new HashSet(); + if (null != weightReportModel.getGestationalHypertensionGHID()) { + set.add(weightReportModel.getGestationalHypertensionGHName()); + } + if (null != weightReportModel.getChronicHypertensionID()) { + set.add(weightReportModel.getChronicHypertensionName()); + } //高血压hypertension - datas.put("2", this.getInfo(weights, data2, weightReportModel, patientWeight, patients, bmiD, week, gxyKcalStr)); + datas.put("3", this.getInfo(weights, data2, weightReportModel, patientWeight, patients, bmiD, week, gxyKcalStr, set)); } else if (reis.equals(weightReportModel.getHyperthyroidismNeedID()) || reis.equals(weightReportModel.getHyperthyroidismID())) { //甲亢hyperthyroidism - datas.put("3", this.getDiabetestInfo(weights, data4, weightReportModel, patientWeight, patients, bmiD, week, gkKcalStr)); + Set set = new HashSet(); + if (null != weightReportModel.getHyperthyroidismNeedID()) { + + set.add(weightReportModel.getHyperthyroidismName()); + } + if (null != weightReportModel.getHyperthyroidismID()) { + set.add(weightReportModel.getHyperthyroidismName()); + } + datas.put("4", this.getDiabetestInfo(weights, data4, weightReportModel, patientWeight, patients, bmiD, week, gkKcalStr, set)); } else if (reis.equals(weightReportModel.getHypothyroidismID()) || reis.equals(weightReportModel.getyLCHypothyroidismID()) || reis.equals(weightReportModel.getHypothyroidismNeedID())) { //甲减hypothyroidism - datas.put("4", this.getDiabetestInfo(weights, data5, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr)); + Set set = new HashSet(); + if (null != weightReportModel.getHypothyroidismID()) { + set.add(weightReportModel.getHypothyroidismName()); + } + if (null != weightReportModel.getyLCHypothyroidismID()) { + set.add(weightReportModel.getyLCHypothyroidismName()); + } + if (null != weightReportModel.getHypothyroidismNeedID()) { + set.add(weightReportModel.getHypothyroidismNeedName()); + } + datas.put("5", this.getDiabetestInfo(weights, data5, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr, set)); } else if (reis.equals(weightReportModel.getAnemiaPregnancyId()) || reis.equals(weightReportModel.getMildAnemiaID()) || reis.equals(weightReportModel.getModerateAnemiaID()) || reis.equals(weightReportModel.getSevereAnemiaID()) || reis.equals(weightReportModel.getSevereAnemiaHBID()) || reis.equals(weightReportModel.getObstructiveAnemiaID())) { + Set set = new HashSet(); + if (null != weightReportModel.getAnemiaPregnancyId()) { + set.add(weightReportModel.getAnemiaPregnancyName()); + } + if (null != weightReportModel.getMildAnemiaID()) { + set.add(weightReportModel.getMildAnemiaName()); + } + if (null != weightReportModel.getModerateAnemiaID()) { + set.add(weightReportModel.getModerateAnemiaName()); + } + if (null != weightReportModel.getSevereAnemiaID()) { + set.add(weightReportModel.getSevereAnemiaName()); + } + if (null != weightReportModel.getSevereAnemiaHBID()) { + set.add(weightReportModel.getSevereAnemiaHBName()); + } + if (null != weightReportModel.getObstructiveAnemiaID()) { + set.add(weightReportModel.getObstructiveAnemiaName()); + } //贫血anemia - datas.put("5", this.getInfo(weights, data0, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr)); + datas.put("6", this.getInfo(weights, data0, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr, set)); } else if (reis.equals(weightReportModel.getDiseasesDigestiveSystemId()) || reis.equals(weightReportModel.getViralHepatitisId())) { + Set set = new HashSet(); + if (null != weightReportModel.getDiseasesDigestiveSystemId()) { + set.add(weightReportModel.getDiseasesDigestiveSystemName()); + } + if (null != weightReportModel.getViralHepatitisId()) { + set.add(weightReportModel.getViralHepatitisName()); + } //急性肝炎acuteHepatitis - datas.put("6", this.getInfo(weights, data1, weightReportModel, patientWeight, patients, bmiD, week, kcals)); + datas.put("7", this.getInfo(weights, data1, weightReportModel, patientWeight, patients, bmiD, week, kcals, set)); } else if (reis.equals(weightReportModel.getCirrhosis()) || reis.equals(weightReportModel.getLiverFunctionErrorId())) { //慢性肝炎chronicHepatitis - datas.put("7", this.getInfo(weights, data6, weightReportModel, patientWeight, patients, bmiD, week, mxgyKcalStr)); + Set set = new HashSet(); + if (null != weightReportModel.getCirrhosis()) { + set.add(weightReportModel.getCirrhosisName()); + } + if (null != weightReportModel.getLiverFunctionErrorId()) { + set.add(weightReportModel.getLiverFunctionErrorName()); + } + datas.put("8", this.getInfo(weights, data6, weightReportModel, patientWeight, patients, bmiD, week, mxgyKcalStr, set)); } } } + } if (datas.size() == 0) { BaseResponse baseResponse = this.report(pid, userId, rid); return baseResponse; } - + if (datas.containsKey("3") && datas.containsKey("8")) { + datas.put("2", datas.get("8")); + } return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(this.getFirstOrNull(datas)); } @@ -2116,7 +2185,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient } - public Map getInfo(Map weights, Map data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal) { + public Map getInfo(Map weights, Map data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal, Set set) { setReport(data, weights, patientWeight.getBeforeWeight(), patientWeight.getBmi(), patientWeight.getDayWeights(), patientWeight.getBregmatic()); Map userMap = new HashMap(); userMap.put("userName", patients.getUsername()); @@ -2129,7 +2198,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient userMap.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); userMap.put("NowWeight", patientWeight.getNowWeight()); userMap.put("BeforeWeight", patientWeight.getBeforeWeight()); - userMap.put("riskFactor", patients.getRiskFactorId()); + userMap.put("riskFactor", set); data.put("userInfo", userMap); Map map2 = new HashMap(); map2.put("guideTitle", weightReportModel.getGuideTitle()); @@ -2177,7 +2246,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient return data; } - public Map getDiabetestInfo(Map weights, Map data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal) { + public Map getDiabetestInfo(Map weights, Map data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal, Set set) { setReport(data, weights, patientWeight.getBeforeWeight(), patientWeight.getBmi(), patientWeight.getDayWeights(), patientWeight.getBregmatic()); Map userMap = new HashMap(); userMap.put("userName", patients.getUsername()); @@ -2190,7 +2259,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient userMap.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); userMap.put("NowWeight", patientWeight.getNowWeight()); userMap.put("BeforeWeight", patientWeight.getBeforeWeight()); - userMap.put("riskFactor", patients.getRiskFactorId()); + userMap.put("riskFactor", set); data.put("userInfo", userMap); Map map2 = new HashMap(); map2.put("guideTitle", weightReportModel.getGuideTitle()); @@ -2779,4 +2848,11 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient return 0.0; } + public static void main(String[] args) { + if (true) { + System.out.println("=========>" + true); + } else if (true) { + System.out.println("6666666666666666"); + } + } }