Commit e95451d5e86683ad51b00f08c2acd7d4e858b2f6
1 parent
3057d3d64c
Exists in
master
and in
6 other branches
体重营养报告接口修改
Showing 1 changed file with 90 additions and 14 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
e95451d
... | ... | @@ -42,6 +42,7 @@ |
42 | 42 | import scala.Int; |
43 | 43 | import scala.util.parsing.combinator.testing.Str; |
44 | 44 | |
45 | +import javax.swing.text.html.parser.Entity; | |
45 | 46 | import java.math.BigDecimal; |
46 | 47 | import java.math.RoundingMode; |
47 | 48 | import java.util.*; |
48 | 49 | |
49 | 50 | |
50 | 51 | |
51 | 52 | |
52 | 53 | |
53 | 54 | |
54 | 55 | |
55 | 56 | |
56 | 57 | |
57 | 58 | |
58 | 59 | |
59 | 60 | |
... | ... | @@ -2053,42 +2054,110 @@ |
2053 | 2054 | weights.put(DateUtil.getWeek2(patients.getLastMenses(), DateUtil.parseYMD(entry.getKey())), entry.getValue()); |
2054 | 2055 | } |
2055 | 2056 | } |
2056 | - for (String reis : reiskFactor) { | |
2057 | - for (WeightReportModel weightReportModel : weightReport) { | |
2057 | + for (WeightReportModel weightReportModel : weightReport) { | |
2058 | + for (String reis : reiskFactor) { | |
2058 | 2059 | if (reis.equals(weightReportModel.getgDMId()) || reis.equals(weightReportModel.getoDIPId()) || |
2059 | 2060 | reis.equals(weightReportModel.getMedicationDiabetesID())) { |
2060 | 2061 | //糖尿病diabetes |
2061 | - datas.put("1", this.getDiabetestInfo(weights, data3, weightReportModel, patientWeight, patients, bmiD, week, diabetesKcalStr)); | |
2062 | + Set set = new HashSet(); | |
2063 | + if (null != weightReportModel.getgDMId()) { | |
2064 | + set.add(weightReportModel.getgDMName()); | |
2065 | + } | |
2066 | + if (null != weightReportModel.getMedicationDiabetesID()) { | |
2067 | + set.add(weightReportModel.getoDIPName()); | |
2068 | + } | |
2069 | + datas.put("1", this.getDiabetestInfo(weights, data3, weightReportModel, patientWeight, patients, bmiD, week, diabetesKcalStr, set)); | |
2062 | 2070 | } else if (reis.equals(weightReportModel.getGestationalHypertensionGHID()) || reis.equals(weightReportModel.getChronicHypertensionID())) { |
2071 | + Set set = new HashSet(); | |
2072 | + if (null != weightReportModel.getGestationalHypertensionGHID()) { | |
2073 | + set.add(weightReportModel.getGestationalHypertensionGHName()); | |
2074 | + } | |
2075 | + if (null != weightReportModel.getChronicHypertensionID()) { | |
2076 | + set.add(weightReportModel.getChronicHypertensionName()); | |
2077 | + } | |
2063 | 2078 | //高血压hypertension |
2064 | - datas.put("2", this.getInfo(weights, data2, weightReportModel, patientWeight, patients, bmiD, week, gxyKcalStr)); | |
2079 | + datas.put("3", this.getInfo(weights, data2, weightReportModel, patientWeight, patients, bmiD, week, gxyKcalStr, set)); | |
2065 | 2080 | } else if (reis.equals(weightReportModel.getHyperthyroidismNeedID()) || reis.equals(weightReportModel.getHyperthyroidismID())) { |
2066 | 2081 | //甲亢hyperthyroidism |
2067 | - datas.put("3", this.getDiabetestInfo(weights, data4, weightReportModel, patientWeight, patients, bmiD, week, gkKcalStr)); | |
2082 | + Set set = new HashSet(); | |
2083 | + if (null != weightReportModel.getHyperthyroidismNeedID()) { | |
2084 | + | |
2085 | + set.add(weightReportModel.getHyperthyroidismName()); | |
2086 | + } | |
2087 | + if (null != weightReportModel.getHyperthyroidismID()) { | |
2088 | + set.add(weightReportModel.getHyperthyroidismName()); | |
2089 | + } | |
2090 | + datas.put("4", this.getDiabetestInfo(weights, data4, weightReportModel, patientWeight, patients, bmiD, week, gkKcalStr, set)); | |
2068 | 2091 | } else if (reis.equals(weightReportModel.getHypothyroidismID()) || reis.equals(weightReportModel.getyLCHypothyroidismID()) || |
2069 | 2092 | reis.equals(weightReportModel.getHypothyroidismNeedID())) { |
2070 | 2093 | //甲减hypothyroidism |
2071 | - datas.put("4", this.getDiabetestInfo(weights, data5, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr)); | |
2094 | + Set set = new HashSet(); | |
2095 | + if (null != weightReportModel.getHypothyroidismID()) { | |
2096 | + set.add(weightReportModel.getHypothyroidismName()); | |
2097 | + } | |
2098 | + if (null != weightReportModel.getyLCHypothyroidismID()) { | |
2099 | + set.add(weightReportModel.getyLCHypothyroidismName()); | |
2100 | + } | |
2101 | + if (null != weightReportModel.getHypothyroidismNeedID()) { | |
2102 | + set.add(weightReportModel.getHypothyroidismNeedName()); | |
2103 | + } | |
2104 | + datas.put("5", this.getDiabetestInfo(weights, data5, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr, set)); | |
2072 | 2105 | } else if (reis.equals(weightReportModel.getAnemiaPregnancyId()) || reis.equals(weightReportModel.getMildAnemiaID()) || |
2073 | 2106 | reis.equals(weightReportModel.getModerateAnemiaID()) || reis.equals(weightReportModel.getSevereAnemiaID()) || |
2074 | 2107 | reis.equals(weightReportModel.getSevereAnemiaHBID()) || reis.equals(weightReportModel.getObstructiveAnemiaID())) { |
2108 | + Set set = new HashSet(); | |
2109 | + if (null != weightReportModel.getAnemiaPregnancyId()) { | |
2110 | + set.add(weightReportModel.getAnemiaPregnancyName()); | |
2111 | + } | |
2112 | + if (null != weightReportModel.getMildAnemiaID()) { | |
2113 | + set.add(weightReportModel.getMildAnemiaName()); | |
2114 | + } | |
2115 | + if (null != weightReportModel.getModerateAnemiaID()) { | |
2116 | + set.add(weightReportModel.getModerateAnemiaName()); | |
2117 | + } | |
2118 | + if (null != weightReportModel.getSevereAnemiaID()) { | |
2119 | + set.add(weightReportModel.getSevereAnemiaName()); | |
2120 | + } | |
2121 | + if (null != weightReportModel.getSevereAnemiaHBID()) { | |
2122 | + set.add(weightReportModel.getSevereAnemiaHBName()); | |
2123 | + } | |
2124 | + if (null != weightReportModel.getObstructiveAnemiaID()) { | |
2125 | + set.add(weightReportModel.getObstructiveAnemiaName()); | |
2126 | + } | |
2075 | 2127 | //贫血anemia |
2076 | - datas.put("5", this.getInfo(weights, data0, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr)); | |
2128 | + datas.put("6", this.getInfo(weights, data0, weightReportModel, patientWeight, patients, bmiD, week, gjKcalStr, set)); | |
2077 | 2129 | } else if (reis.equals(weightReportModel.getDiseasesDigestiveSystemId()) || reis.equals(weightReportModel.getViralHepatitisId())) { |
2130 | + Set set = new HashSet(); | |
2131 | + if (null != weightReportModel.getDiseasesDigestiveSystemId()) { | |
2132 | + set.add(weightReportModel.getDiseasesDigestiveSystemName()); | |
2133 | + } | |
2134 | + if (null != weightReportModel.getViralHepatitisId()) { | |
2135 | + set.add(weightReportModel.getViralHepatitisName()); | |
2136 | + } | |
2078 | 2137 | //急性肝炎acuteHepatitis |
2079 | - datas.put("6", this.getInfo(weights, data1, weightReportModel, patientWeight, patients, bmiD, week, kcals)); | |
2138 | + datas.put("7", this.getInfo(weights, data1, weightReportModel, patientWeight, patients, bmiD, week, kcals, set)); | |
2080 | 2139 | } else if (reis.equals(weightReportModel.getCirrhosis()) || reis.equals(weightReportModel.getLiverFunctionErrorId())) { |
2081 | 2140 | //慢性肝炎chronicHepatitis |
2082 | - datas.put("7", this.getInfo(weights, data6, weightReportModel, patientWeight, patients, bmiD, week, mxgyKcalStr)); | |
2141 | + Set set = new HashSet(); | |
2142 | + if (null != weightReportModel.getCirrhosis()) { | |
2143 | + set.add(weightReportModel.getCirrhosisName()); | |
2144 | + } | |
2145 | + if (null != weightReportModel.getLiverFunctionErrorId()) { | |
2146 | + set.add(weightReportModel.getLiverFunctionErrorName()); | |
2147 | + } | |
2148 | + datas.put("8", this.getInfo(weights, data6, weightReportModel, patientWeight, patients, bmiD, week, mxgyKcalStr, set)); | |
2083 | 2149 | } |
2084 | 2150 | } |
2085 | 2151 | } |
2152 | + | |
2086 | 2153 | } |
2087 | 2154 | if (datas.size() == 0) { |
2088 | 2155 | BaseResponse baseResponse = this.report(pid, userId, rid); |
2089 | 2156 | return baseResponse; |
2090 | 2157 | } |
2091 | - | |
2158 | + if (datas.containsKey("3") && datas.containsKey("8")) { | |
2159 | + datas.put("2", datas.get("8")); | |
2160 | + } | |
2092 | 2161 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(this.getFirstOrNull(datas)); |
2093 | 2162 | } |
2094 | 2163 | |
... | ... | @@ -2116,7 +2185,7 @@ |
2116 | 2185 | } |
2117 | 2186 | |
2118 | 2187 | |
2119 | - public Map getInfo(Map<Integer, String> weights, Map<String, Object> data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal) { | |
2188 | + public Map getInfo(Map<Integer, String> weights, Map<String, Object> data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal, Set set) { | |
2120 | 2189 | setReport(data, weights, patientWeight.getBeforeWeight(), patientWeight.getBmi(), patientWeight.getDayWeights(), patientWeight.getBregmatic()); |
2121 | 2190 | Map userMap = new HashMap(); |
2122 | 2191 | userMap.put("userName", patients.getUsername()); |
... | ... | @@ -2129,7 +2198,7 @@ |
2129 | 2198 | userMap.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
2130 | 2199 | userMap.put("NowWeight", patientWeight.getNowWeight()); |
2131 | 2200 | userMap.put("BeforeWeight", patientWeight.getBeforeWeight()); |
2132 | - userMap.put("riskFactor", patients.getRiskFactorId()); | |
2201 | + userMap.put("riskFactor", set); | |
2133 | 2202 | data.put("userInfo", userMap); |
2134 | 2203 | Map map2 = new HashMap(); |
2135 | 2204 | map2.put("guideTitle", weightReportModel.getGuideTitle()); |
... | ... | @@ -2177,7 +2246,7 @@ |
2177 | 2246 | return data; |
2178 | 2247 | } |
2179 | 2248 | |
2180 | - public Map getDiabetestInfo(Map<Integer, String> weights, Map<String, Object> data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal) { | |
2249 | + public Map getDiabetestInfo(Map<Integer, String> weights, Map<String, Object> data, WeightReportModel weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week, String kcal, Set set) { | |
2181 | 2250 | setReport(data, weights, patientWeight.getBeforeWeight(), patientWeight.getBmi(), patientWeight.getDayWeights(), patientWeight.getBregmatic()); |
2182 | 2251 | Map userMap = new HashMap(); |
2183 | 2252 | userMap.put("userName", patients.getUsername()); |
... | ... | @@ -2190,7 +2259,7 @@ |
2190 | 2259 | userMap.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
2191 | 2260 | userMap.put("NowWeight", patientWeight.getNowWeight()); |
2192 | 2261 | userMap.put("BeforeWeight", patientWeight.getBeforeWeight()); |
2193 | - userMap.put("riskFactor", patients.getRiskFactorId()); | |
2262 | + userMap.put("riskFactor", set); | |
2194 | 2263 | data.put("userInfo", userMap); |
2195 | 2264 | Map map2 = new HashMap(); |
2196 | 2265 | map2.put("guideTitle", weightReportModel.getGuideTitle()); |
... | ... | @@ -2779,5 +2848,12 @@ |
2779 | 2848 | return 0.0; |
2780 | 2849 | } |
2781 | 2850 | |
2851 | + public static void main(String[] args) { | |
2852 | + if (true) { | |
2853 | + System.out.println("=========>" + true); | |
2854 | + } else if (true) { | |
2855 | + System.out.println("6666666666666666"); | |
2856 | + } | |
2857 | + } | |
2782 | 2858 | } |