Commit 82488639b3b24310eb660c9b5c07eeffa56728fc
1 parent
ad76d2ab21
Exists in
master
and in
7 other branches
抽取查看接口代码
Showing 8 changed files with 1003 additions and 897 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
8248863
| ... | ... | @@ -251,31 +251,6 @@ |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
| 254 | - //查询初诊接口 | |
| 255 | - @RequestMapping(value = "/findAntExChuData",method = RequestMethod.GET) | |
| 256 | - @ResponseBody | |
| 257 | -// @TokenRequired | |
| 258 | - public BaseObjectResponse findAntExChuData(@RequestParam("id")String id, | |
| 259 | - HttpServletRequest request){ | |
| 260 | - BaseObjectResponse br = antenatalExaminationFacade.findAntExChu(id); | |
| 261 | - return br; | |
| 262 | - } | |
| 263 | - | |
| 264 | - | |
| 265 | - /** | |
| 266 | - * 查询复诊接口 | |
| 267 | - * @param id | |
| 268 | - * @param request | |
| 269 | - * @return | |
| 270 | - */ | |
| 271 | - @RequestMapping(value = "/findAntenatalExaminationData",method = RequestMethod.GET) | |
| 272 | - @ResponseBody | |
| 273 | -// @TokenRequired | |
| 274 | - public BaseObjectResponse findAntenatalExaminationData(@RequestParam("id")String id, | |
| 275 | - HttpServletRequest request){ | |
| 276 | - | |
| 277 | - return antenatalExaminationFacade.findAntenatalExamination(id); | |
| 278 | - } | |
| 279 | 254 | |
| 280 | 255 | |
| 281 | 256 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
View file @
8248863
| ... | ... | @@ -328,12 +328,6 @@ |
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - @RequestMapping(value = "/findMatDeliverData", method = RequestMethod.GET) | |
| 332 | - @ResponseBody | |
| 333 | -// @TokenRequired | |
| 334 | - public BaseObjectResponse findMatDeliverData(@RequestParam("id")String id){ | |
| 335 | - return matDeliverFacade.findMatDeliverData(id); | |
| 336 | - } | |
| 337 | 331 | |
| 338 | 332 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
View file @
8248863
| ... | ... | @@ -487,17 +487,6 @@ |
| 487 | 487 | doctorNo); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | - /** | |
| 491 | - * 查看孕妇建档信息 | |
| 492 | - * @param id 孕妇ID | |
| 493 | - * @return | |
| 494 | - */ | |
| 495 | - @RequestMapping(value = "/findPatientData", method = RequestMethod.GET) | |
| 496 | - @ResponseBody | |
| 497 | - @TokenRequired | |
| 498 | - public BaseObjectResponse findPatientData(@RequestParam("id")String id){ | |
| 499 | - return bookbuildingFacade.findPatientData(id); | |
| 500 | - } | |
| 501 | 490 | |
| 502 | 491 | |
| 503 | 492 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
8248863
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 4 | +import com.lyms.platform.common.base.BaseController; | |
| 5 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 6 | +import com.lyms.platform.operate.web.facade.ViewFacade; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Controller; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 12 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 13 | + | |
| 14 | +import javax.servlet.http.HttpServletRequest; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * | |
| 18 | + * 所有查看页面接口 | |
| 19 | + * | |
| 20 | + * Created by Administrator on 2017/1/16 0016. | |
| 21 | + */ | |
| 22 | +@Controller | |
| 23 | +public class ViewController extends BaseController{ | |
| 24 | + | |
| 25 | + @Autowired | |
| 26 | + private ViewFacade viewFacade; | |
| 27 | + | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 查询初诊接口 | |
| 31 | + * @param id | |
| 32 | + * @param request | |
| 33 | + * @return | |
| 34 | + */ | |
| 35 | + @RequestMapping(value = "/findAntExChuData",method = RequestMethod.GET) | |
| 36 | + @ResponseBody | |
| 37 | +// @TokenRequired | |
| 38 | + public BaseObjectResponse findAntExChuData(@RequestParam("id")String id, | |
| 39 | + HttpServletRequest request){ | |
| 40 | + BaseObjectResponse br = viewFacade.findAntExChu(id); | |
| 41 | + return br; | |
| 42 | + } | |
| 43 | + | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * 查询复诊接口 | |
| 47 | + * @param id | |
| 48 | + * @param request | |
| 49 | + * @return | |
| 50 | + */ | |
| 51 | + @RequestMapping(value = "/findAntenatalExaminationData",method = RequestMethod.GET) | |
| 52 | + @ResponseBody | |
| 53 | +// @TokenRequired | |
| 54 | + public BaseObjectResponse findAntenatalExaminationData(@RequestParam("id")String id, | |
| 55 | + HttpServletRequest request){ | |
| 56 | + | |
| 57 | + return viewFacade.findAntenatalExamination(id); | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 查看分娩接口 | |
| 62 | + * @param id | |
| 63 | + * @return | |
| 64 | + */ | |
| 65 | + @RequestMapping(value = "/findMatDeliverData", method = RequestMethod.GET) | |
| 66 | + @ResponseBody | |
| 67 | +// @TokenRequired | |
| 68 | + public BaseObjectResponse findMatDeliverData(@RequestParam("id")String id){ | |
| 69 | + return viewFacade.findMatDeliverData(id); | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 查看孕妇建档信息 | |
| 74 | + * @param id 孕妇ID | |
| 75 | + * @return | |
| 76 | + */ | |
| 77 | + @RequestMapping(value = "/findPatientData", method = RequestMethod.GET) | |
| 78 | + @ResponseBody | |
| 79 | +// @TokenRequired | |
| 80 | + public BaseObjectResponse findPatientData(@RequestParam("id")String id){ | |
| 81 | + return viewFacade.findPatientData(id); | |
| 82 | + } | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
8248863
| ... | ... | @@ -2164,412 +2164,5 @@ |
| 2164 | 2164 | return list; |
| 2165 | 2165 | } |
| 2166 | 2166 | |
| 2167 | - //查询复诊接口 | |
| 2168 | - public BaseObjectResponse findAntenatalExamination(String id){ | |
| 2169 | - | |
| 2170 | - BaseObjectResponse br = new BaseObjectResponse(); | |
| 2171 | - if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 2172 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 2173 | - br.setErrormsg("id为空"); | |
| 2174 | - return br; | |
| 2175 | - } | |
| 2176 | - | |
| 2177 | - AntenatalExaminationModel data = antExService.findOneById(id); | |
| 2178 | - if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 2179 | - br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 2180 | - br.setErrormsg("没有查询到数据"); | |
| 2181 | - return br; | |
| 2182 | - } | |
| 2183 | - | |
| 2184 | - | |
| 2185 | - if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())){ | |
| 2186 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 2187 | - br.setErrormsg("数据异常"); | |
| 2188 | - return br; | |
| 2189 | - } | |
| 2190 | - | |
| 2191 | - Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 2192 | - if (patients==null || patients.getYn()==YnEnums.NO.getId()){ | |
| 2193 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 2194 | - br.setErrormsg("孕妇信息不存在"); | |
| 2195 | - return br; | |
| 2196 | - } | |
| 2197 | - | |
| 2198 | - Map<String,Object> map= new HashMap<>(); | |
| 2199 | - /* 基本信息 */ | |
| 2200 | - //孕妇基本信息 | |
| 2201 | - map.put("id",data.getId()); | |
| 2202 | - map.put("username",patients.getUsername()); | |
| 2203 | - map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 2204 | - map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 2205 | - map.put("phone",patients.getPhone()); | |
| 2206 | - map.put("fmWeek",patients.getFmWeek()); | |
| 2207 | - map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 2208 | - map.put("mremark",patients.getMremark()); | |
| 2209 | - map.put("oRiskFactor",patients.getoRiskFactor()); | |
| 2210 | - map.put("riskScore",patients.getRiskScore()); | |
| 2211 | - //产检基本信息 | |
| 2212 | - map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate())); | |
| 2213 | - map.put("currentDueDate",data.getCurrentDueDate()); | |
| 2214 | - | |
| 2215 | - String checkDoctor = ""; | |
| 2216 | - | |
| 2217 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getCheckDoctor())){ | |
| 2218 | - Users users = usersService.getUsers(Integer.parseInt(data.getCheckDoctor())); | |
| 2219 | - if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 2220 | - checkDoctor = users.getName(); | |
| 2221 | - } | |
| 2222 | - } | |
| 2223 | - map.put("checkDoctor", checkDoctor); | |
| 2224 | - | |
| 2225 | - String hospital = ""; | |
| 2226 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 2227 | - Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
| 2228 | - if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 2229 | - hospital = organization.getName(); | |
| 2230 | - } | |
| 2231 | - } | |
| 2232 | - map.put("hospital", hospital); | |
| 2233 | - map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
| 2234 | - map.put("cDueWeek", data.getcDueWeek()); | |
| 2235 | - | |
| 2236 | - /* 复诊信息 */ | |
| 2237 | - map.put("chiefComplaint", data.getChiefComplaint()); | |
| 2238 | - map.put("weight", UnitUtils.unitSplice(data.getWeight(), UnitConstants.KG)); | |
| 2239 | - // 血压 | |
| 2240 | - String ssy = ""; | |
| 2241 | - String szy = ""; | |
| 2242 | - Map<String, String> chBpMap = JsonUtil.getMap(data.getBp()); | |
| 2243 | - if (MapUtils.isNotEmpty(chBpMap)) { | |
| 2244 | - ssy = chBpMap.get("ssy"); | |
| 2245 | - szy = chBpMap.get("szy"); | |
| 2246 | - } | |
| 2247 | - map.put("bp", UnitUtils.unitSplice(ssy + "/" + szy, UnitConstants.MMHG)); | |
| 2248 | - map.put("gongGao", UnitUtils.unitSplice(data.getGongGao(), UnitConstants.CM)); | |
| 2249 | - map.put("abdominalCircumference", UnitUtils.unitSplice(data.getAbdominalCircumference(), UnitConstants.CM)); | |
| 2250 | - String edema = ""; | |
| 2251 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getEdema())){ | |
| 2252 | - for (FuZhongEnums fuZhongEnums:FuZhongEnums.values()){ | |
| 2253 | - if (data.getEdema().equals(fuZhongEnums.getId())){ | |
| 2254 | - edema = fuZhongEnums.getName(); | |
| 2255 | - } | |
| 2256 | - } | |
| 2257 | - } | |
| 2258 | - map.put("edema",edema); | |
| 2259 | - | |
| 2260 | - map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); | |
| 2261 | - //胎儿情况 | |
| 2262 | - List<Map> tireList = new ArrayList<>(); | |
| 2263 | - if (CollectionUtils.isNotEmpty(data.getTireData())){ | |
| 2264 | - for (Object temp : data.getTireData()){ | |
| 2265 | - Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
| 2266 | - String heartRate = tire.get("heartRate"); | |
| 2267 | - String fetalPosition = tire.get("fetalPosition"); | |
| 2268 | - String fetalPresentation = tire.get("fetalPresentation"); | |
| 2269 | - String join = tire.get("join"); | |
| 2270 | - | |
| 2271 | - Map<String,Object> tireMap = new HashMap<>(); | |
| 2272 | - tireMap.put("heartRate",UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 2273 | - tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); | |
| 2274 | - tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); | |
| 2275 | - tireMap.put("join", JoinEnums.getTitle(join)); | |
| 2276 | - tireList.add(tireMap); | |
| 2277 | - } | |
| 2278 | - } | |
| 2279 | - map.put("tireData",tireList); | |
| 2280 | - | |
| 2281 | - /* 辅助信息 */ | |
| 2282 | - map.put("hemoglobin", UnitUtils.unitSplice(data.getHemoglobin(), UnitConstants.GL)); | |
| 2283 | - map.put("urineProtein",data.getUrineProtein()); | |
| 2284 | - map.put("bloodSugar", UnitUtils.unitSplice(data.getUrineProtein(), UnitConstants.MMOLL)); | |
| 2285 | - map.put("bChao",data.getbChao()); | |
| 2286 | - | |
| 2287 | - /* 诊断指导 */ | |
| 2288 | - String diagnosis = ""; | |
| 2289 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())){ | |
| 2290 | - List<String> temp = JsonUtil.toList(data.getDiagnosis(), String.class); | |
| 2291 | - if (CollectionUtils.isNotEmpty(temp)){ | |
| 2292 | - | |
| 2293 | - StringBuilder sb = new StringBuilder(); | |
| 2294 | - | |
| 2295 | - for (String sId : temp){ | |
| 2296 | - sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(","); | |
| 2297 | - } | |
| 2298 | - if (sb.toString().endsWith(",")) { | |
| 2299 | - diagnosis = sb.substring(0, sb.length() - 1); | |
| 2300 | - }else { | |
| 2301 | - diagnosis = sb.toString(); | |
| 2302 | - } | |
| 2303 | - } | |
| 2304 | - } | |
| 2305 | - map.put("diagnosis",diagnosis); | |
| 2306 | - map.put("treatmentOpinion",data.getTreatmentOpinion()); | |
| 2307 | - map.put("guide",data.getGuide()); | |
| 2308 | - | |
| 2309 | - br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2310 | - br.setErrormsg("成功"); | |
| 2311 | - br.setData(map); | |
| 2312 | - return br; | |
| 2313 | - } | |
| 2314 | - | |
| 2315 | - public BaseObjectResponse findAntExChu(String id){ | |
| 2316 | - | |
| 2317 | - BaseObjectResponse br = new BaseObjectResponse(); | |
| 2318 | - | |
| 2319 | - if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 2320 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 2321 | - br.setErrormsg("id为空"); | |
| 2322 | - return br; | |
| 2323 | - } | |
| 2324 | - | |
| 2325 | - AntExChuModel data = antExService.findOne(id); | |
| 2326 | - if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 2327 | - br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 2328 | - br.setErrormsg("没有查询到数据"); | |
| 2329 | - return br; | |
| 2330 | - } | |
| 2331 | - | |
| 2332 | - | |
| 2333 | - if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())){ | |
| 2334 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 2335 | - br.setErrormsg("数据异常"); | |
| 2336 | - return br; | |
| 2337 | - } | |
| 2338 | - | |
| 2339 | - Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 2340 | - if (patients==null || patients.getYn()==YnEnums.NO.getId()){ | |
| 2341 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 2342 | - br.setErrormsg("孕妇信息不存在"); | |
| 2343 | - return br; | |
| 2344 | - } | |
| 2345 | - | |
| 2346 | - Map<String,Object> map= new HashMap<>(); | |
| 2347 | - /* 基本信息 */ | |
| 2348 | - //孕妇基本信息 | |
| 2349 | - map.put("id",data.getId()); | |
| 2350 | - map.put("username",patients.getUsername()); | |
| 2351 | - map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 2352 | - map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 2353 | - map.put("phone",patients.getPhone()); | |
| 2354 | - map.put("fmWeek",patients.getFmWeek()); | |
| 2355 | - map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 2356 | - map.put("mremark",patients.getMremark()); | |
| 2357 | - map.put("oRiskFactor",patients.getoRiskFactor());//TODO 高危需要处理 | |
| 2358 | - map.put("riskScore",patients.getRiskScore()); | |
| 2359 | - //产检基本信息 | |
| 2360 | - map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckTime())); | |
| 2361 | - //TODO 产检孕周 | |
| 2362 | - String checkDoctor = ""; | |
| 2363 | - | |
| 2364 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getProdDoctor())){ | |
| 2365 | - Users users = usersService.getUsers(Integer.parseInt(data.getProdDoctor())); | |
| 2366 | - if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 2367 | - checkDoctor = users.getName(); | |
| 2368 | - } | |
| 2369 | - } | |
| 2370 | - map.put("checkDoctor", checkDoctor); | |
| 2371 | - String hospital = ""; | |
| 2372 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 2373 | - Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
| 2374 | - if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 2375 | - hospital = organization.getName(); | |
| 2376 | - } | |
| 2377 | - } | |
| 2378 | - map.put("hospital", hospital); | |
| 2379 | - map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
| 2380 | - map.put("cDueWeek", data.getcDueWeek()); | |
| 2381 | - | |
| 2382 | - /* 初诊信息 */ | |
| 2383 | - //既往史 | |
| 2384 | - String pastHistory = ""; | |
| 2385 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPastHistory())){ | |
| 2386 | - Map map1 = JsonUtil.jkstr2Obj(data.getPastHistory(),Map.class); | |
| 2387 | - pastHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2388 | - } | |
| 2389 | - map.put("pastHistory", pastHistory); | |
| 2390 | - //家族史 | |
| 2391 | - String familyHistory = ""; | |
| 2392 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getFamilyHistory())){ | |
| 2393 | - Map map1 = JsonUtil.jkstr2Obj(data.getFamilyHistory(),Map.class); | |
| 2394 | - familyHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2395 | - } | |
| 2396 | - map.put("familyHistory", familyHistory); | |
| 2397 | - //个人史 | |
| 2398 | - String personalHistory = ""; | |
| 2399 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPersonalHistory())){ | |
| 2400 | - Map map1 = JsonUtil.jkstr2Obj(data.getPersonalHistory(),Map.class); | |
| 2401 | - personalHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2402 | - } | |
| 2403 | - map.put("personalHistory", personalHistory); | |
| 2404 | - //疫苗接种史 | |
| 2405 | - String ymjzHistory = ""; | |
| 2406 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYmjzHistory())){ | |
| 2407 | - Map map1 = JsonUtil.jkstr2Obj(data.getYmjzHistory(),Map.class); | |
| 2408 | - ymjzHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2409 | - } | |
| 2410 | - map.put("ymjzHistory", ymjzHistory); | |
| 2411 | - //药物过敏史 | |
| 2412 | - String ywgmHistory = ""; | |
| 2413 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYwgmHistory())){ | |
| 2414 | - Map map1 = JsonUtil.jkstr2Obj(data.getYwgmHistory(),Map.class); | |
| 2415 | - ywgmHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2416 | - } | |
| 2417 | - map.put("ywgmHistory", ywgmHistory); | |
| 2418 | - //妇科手术史 | |
| 2419 | - String fksxHistory = ""; | |
| 2420 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getFksxHistory())){ | |
| 2421 | - Map map1 = JsonUtil.jkstr2Obj(data.getFksxHistory(),Map.class); | |
| 2422 | - fksxHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2423 | - } | |
| 2424 | - map.put("fksxHistory", fksxHistory); | |
| 2425 | - //叶酸服用 | |
| 2426 | - String ysfyHistory = ""; | |
| 2427 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYsfyHistory())){ | |
| 2428 | - Map map1 = JsonUtil.jkstr2Obj(data.getYsfyHistory(),Map.class); | |
| 2429 | - ysfyHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2430 | - } | |
| 2431 | - map.put("ysfyHistory", ysfyHistory); | |
| 2432 | - //本次妊娠情况 | |
| 2433 | - String cestationInfo = ""; | |
| 2434 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getCestationInfo())){ | |
| 2435 | - Map map1 = JsonUtil.jkstr2Obj(data.getCestationInfo(),Map.class); | |
| 2436 | - cestationInfo = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 2437 | - } | |
| 2438 | - map.put("cestationInfo", cestationInfo); | |
| 2439 | - | |
| 2440 | - //孕产史 | |
| 2441 | - map.put("pregnancyTimes", UnitUtils.unitSplice(data.getPregnancyTimes(),UnitConstants.CI)); | |
| 2442 | - map.put("prodTime", UnitUtils.unitSplice(data.getProdTime(),UnitConstants.CI)); | |
| 2443 | - map.put("delivery", UnitUtils.unitSplice(data.getDelivery(),UnitConstants.CI)); | |
| 2444 | - map.put("planedProd", UnitUtils.unitSplice(data.getPlanedProd(),UnitConstants.CI)); | |
| 2445 | - map.put("abortion", UnitUtils.unitSplice(data.getAbortion(),UnitConstants.CI)); | |
| 2446 | - map.put("stillbirth", UnitUtils.unitSplice(data.getStillbirth(),UnitConstants.CI)); | |
| 2447 | - map.put("stillChan", UnitUtils.unitSplice(data.getStillChan(),UnitConstants.CI)); | |
| 2448 | - map.put("neoDeath", UnitUtils.unitSplice(data.getNeoDeath(),UnitConstants.CI)); | |
| 2449 | - map.put("birthDefect", UnitUtils.unitSplice(data.getBirthDefect(),UnitConstants.CI)); | |
| 2450 | - | |
| 2451 | - map.put("height", UnitUtils.unitSplice(data.getHeight(),UnitConstants.CM)); | |
| 2452 | - map.put("weight", UnitUtils.unitSplice(data.getWeight(),UnitConstants.KG)); | |
| 2453 | - map.put("yqWeight", UnitUtils.unitSplice(data.getYqWeight(),UnitConstants.KG)); | |
| 2454 | - // 血压 | |
| 2455 | - String ssy = ""; | |
| 2456 | - String szy = ""; | |
| 2457 | - Map<String, String> chBpMap = JsonUtil.getMap(data.getBp()); | |
| 2458 | - if (MapUtils.isNotEmpty(chBpMap)) { | |
| 2459 | - ssy = chBpMap.get("ssy"); | |
| 2460 | - szy = chBpMap.get("szy"); | |
| 2461 | - } | |
| 2462 | - map.put("bp", UnitUtils.unitSplice(ssy + "/" + szy, UnitConstants.MMHG)); | |
| 2463 | - | |
| 2464 | - map.put("heart", data.getHeart()); | |
| 2465 | - map.put("lungs", data.getLungs()); | |
| 2466 | - map.put("vulva", data.getVulva()); | |
| 2467 | - map.put("vagina", data.getVagina()); | |
| 2468 | - map.put("cervical", data.getCervical()); | |
| 2469 | - map.put("uterus", data.getUterus()); | |
| 2470 | - map.put("fujian", data.getFujian()); | |
| 2471 | - | |
| 2472 | - map.put("gonggao", UnitUtils.unitSplice(data.getGonggao(),UnitConstants.CM)); | |
| 2473 | - map.put("fuwei", UnitUtils.unitSplice(data.getFuwei(),UnitConstants.CM)); | |
| 2474 | - map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); | |
| 2475 | - //胎儿情况 | |
| 2476 | - List<Map> placentas = new ArrayList<>(); | |
| 2477 | - if (CollectionUtils.isNotEmpty(data.getPlacentas())){ | |
| 2478 | - for (Object temp : data.getPlacentas()){ | |
| 2479 | - Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
| 2480 | - String heartRate = tire.get("heartRate"); | |
| 2481 | - String fetalPosition = tire.get("fetalPosition"); | |
| 2482 | - String fetalPresentation = tire.get("fetalPresentation"); | |
| 2483 | - String join = tire.get("join"); | |
| 2484 | - | |
| 2485 | - Map<String,Object> tireMap = new HashMap<>(); | |
| 2486 | - tireMap.put("heartRate",UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 2487 | - tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); | |
| 2488 | - tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); | |
| 2489 | - tireMap.put("join", JoinEnums.getTitle(join)); | |
| 2490 | - placentas.add(tireMap); | |
| 2491 | - } | |
| 2492 | - } | |
| 2493 | - map.put("placentas",placentas); | |
| 2494 | - | |
| 2495 | - /* 辅助检查 */ | |
| 2496 | - map.put("xhdb",UnitUtils.unitSplice(data.getXhdb(),UnitConstants.GL)); | |
| 2497 | - map.put("bxbjs",UnitUtils.unitSplice(data.getBxbjs(),UnitConstants.TEN_LKG)); | |
| 2498 | - map.put("platelet",UnitUtils.unitSplice(data.getPlatelet(),UnitConstants.TEN_LKG)); | |
| 2499 | - map.put("chgOther",data.getChgOther()); | |
| 2500 | - | |
| 2501 | - map.put("ndb",data.getNdb()); | |
| 2502 | - map.put("nt",data.getNt()); | |
| 2503 | - map.put("urineKetone",data.getUrineKetone()); | |
| 2504 | - map.put("bld",data.getBld()); | |
| 2505 | - map.put("ncgOther",data.getNcgOther()); | |
| 2506 | - | |
| 2507 | - map.put("abo",FunvCommonUtil.getBaseicConfigByid(data.getAbo(), basicConfigService)); | |
| 2508 | - map.put("rh",data.getRh()); | |
| 2509 | - map.put("bloodSugar",data.getBloodSugar()); | |
| 2510 | - map.put("xqgbzam",UnitUtils.unitSplice(data.getXqgbzam(), UnitConstants.UL)); | |
| 2511 | - map.put("xqgczam",UnitUtils.unitSplice(data.getXqgczam(), UnitConstants.UL)); | |
| 2512 | - map.put("albumin",UnitUtils.unitSplice(data.getAlbumin(), UnitConstants.GL)); | |
| 2513 | - map.put("totalBilirubin",UnitUtils.unitSplice(data.getTotalBilirubin(), UnitConstants.UMOLL)); | |
| 2514 | - map.put("jhBilirubin",UnitUtils.unitSplice(data.getJhBilirubin(), UnitConstants.UMOLL)); | |
| 2515 | - map.put("bg",data.getBg()); | |
| 2516 | - | |
| 2517 | - map.put("ygbmky",FunvCommonUtil.checkYiGan(data.getYgbmky())); | |
| 2518 | - map.put("ygbmkt",FunvCommonUtil.checkYiGan(data.getYgbmky())); | |
| 2519 | - map.put("ygeky",FunvCommonUtil.checkYiGan(data.getYgeky())); | |
| 2520 | - map.put("ygekt",FunvCommonUtil.checkYiGan(data.getYgekt())); | |
| 2521 | - map.put("yghxkt",FunvCommonUtil.checkYiGan(data.getYghxkt())); | |
| 2522 | - | |
| 2523 | - map.put("xqjq",UnitUtils.unitSplice(data.getXqjq(), UnitConstants.UL)); | |
| 2524 | - map.put("xnsd",UnitUtils.unitSplice(data.getXnsd(), UnitConstants.UL)); | |
| 2525 | - | |
| 2526 | - map.put("hivkt",FunvCommonUtil.checkYiGan(data.getHivkt())); | |
| 2527 | - | |
| 2528 | - String ydfmw = ""; | |
| 2529 | - String ydqjd = ""; | |
| 2530 | - | |
| 2531 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYdfmw())){ | |
| 2532 | - Map ydfmwMap = JsonUtil.str2Obj(data.getYdfmw(), Map.class); | |
| 2533 | - ydfmw = ResolveUtils.replaceYDFMW(ydfmwMap, 1); | |
| 2534 | - ydqjd = ResolveUtils.replaceYDFMW(ydfmwMap,2); | |
| 2535 | - } | |
| 2536 | - | |
| 2537 | - map.put("ydfmw",ydfmw); | |
| 2538 | - map.put("ydqjd",ydqjd); | |
| 2539 | - map.put("bChao",data.getbChao()); | |
| 2540 | - | |
| 2541 | - | |
| 2542 | - /* 诊断指导 */ | |
| 2543 | - String diagnosis = ""; | |
| 2544 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())){ | |
| 2545 | - List<String> temp = JsonUtil.toList(data.getDiagnosis(), String.class); | |
| 2546 | - if (CollectionUtils.isNotEmpty(temp)){ | |
| 2547 | - | |
| 2548 | - StringBuilder sb = new StringBuilder(); | |
| 2549 | - | |
| 2550 | - for (String sId : temp){ | |
| 2551 | - sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(","); | |
| 2552 | - } | |
| 2553 | - if (sb.toString().endsWith(",")) { | |
| 2554 | - diagnosis = sb.substring(0, sb.length() - 1); | |
| 2555 | - }else { | |
| 2556 | - diagnosis = sb.toString(); | |
| 2557 | - } | |
| 2558 | - } | |
| 2559 | - } | |
| 2560 | - map.put("diagnosis",diagnosis); | |
| 2561 | - map.put("treatOpinion",data.getTreatOpinion()); | |
| 2562 | - map.put("dirOpinion",data.getDirOpinion()); | |
| 2563 | - | |
| 2564 | - br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2565 | - br.setErrormsg("成功"); | |
| 2566 | - br.setData(map); | |
| 2567 | - | |
| 2568 | - return br; | |
| 2569 | - } | |
| 2570 | - | |
| 2571 | - | |
| 2572 | - | |
| 2573 | - | |
| 2574 | 2167 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
8248863
| ... | ... | @@ -1488,75 +1488,7 @@ |
| 1488 | 1488 | return ""; |
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | - public BaseObjectResponse findPatientData(String id) { | |
| 1492 | 1491 | |
| 1493 | - BaseObjectResponse br = new BaseObjectResponse(); | |
| 1494 | - if (org.apache.commons.lang.StringUtils.isEmpty(id)) { | |
| 1495 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1496 | - br.setErrormsg("id为空"); | |
| 1497 | - return br; | |
| 1498 | - } | |
| 1499 | - | |
| 1500 | - Patients data = patientsService.findOnePatientById(id); | |
| 1501 | - if (data == null || data.getYn() == YnEnums.NO.getId()) { | |
| 1502 | - br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 1503 | - br.setErrormsg("没有查询到数据"); | |
| 1504 | - return br; | |
| 1505 | - } | |
| 1506 | - | |
| 1507 | - Map<String, Object> map = new HashMap<>(); | |
| 1508 | - map.put("id", data.getId()); | |
| 1509 | - /* 孕妇基础数据 */ | |
| 1510 | - map.put("username", data.getUsername()); | |
| 1511 | - map.put("pcerteType", getBasicConfig(data.getPcerteTypeId())); | |
| 1512 | - map.put("cardNo", data.getCardNo()); | |
| 1513 | - map.put("pcountry", getBasicConfig(data.getPcountryId())); | |
| 1514 | - map.put("pnation", getBasicConfig(data.getPnationId())); | |
| 1515 | - map.put("birth", DateUtil.getyyyy_MM_dd(data.getBirth())); | |
| 1516 | - map.put("age", DateUtil.getAge(data.getBirth())); | |
| 1517 | - map.put("pcensusType", getBasicConfig(data.getPcensusTypeId())); | |
| 1518 | - map.put("pliveType", getBasicConfig(data.getPliveTypeId())); | |
| 1519 | - map.put("pprofessionType", getBasicConfig(data.getPprofessionTypeId())); | |
| 1520 | - map.put("plevelType", getBasicConfig(data.getPlevelTypeId())); | |
| 1521 | - //TODO 家庭人均收入 | |
| 1522 | - | |
| 1523 | - /* 孕妇联系方式 */ | |
| 1524 | - map.put("residence", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 1525 | - data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 1526 | - map.put("register", CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(), | |
| 1527 | - data.getAreaRegisterId(), data.getStreetRegisterId(), data.getAddressRegister(), basicConfigService)); | |
| 1528 | - map.put("postRest", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 1529 | - data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 1530 | - | |
| 1531 | - /* 丈夫信息 */ | |
| 1532 | - map.put("husbandName", data.getHusbandName()); | |
| 1533 | - map.put("hcertificateType", getBasicConfig(data.getHcertificateTypeId())); | |
| 1534 | - map.put("hcertificateNum", data.getHcertificateNum()); | |
| 1535 | - map.put("hcountry", getBasicConfig(data.getHcountryId())); | |
| 1536 | - map.put("hnation", getBasicConfig(data.getHnationId())); | |
| 1537 | - map.put("husbandPhone", data.getHusbandPhone()); | |
| 1538 | - map.put("hprofessionType", getBasicConfig(data.getHprofessionTypeId())); | |
| 1539 | - map.put("hworkUnit", data.getHworkUnit()); | |
| 1540 | - map.put("hregister", CommonsHelper.getResidence(data.getHprovinceRegisterId(), data.getHcityRegisterId(), | |
| 1541 | - data.getHareaRegisterId(), data.getHstreetRegisterId(), data.getHaddressRegister(), | |
| 1542 | - basicConfigService)); | |
| 1543 | - | |
| 1544 | - /* 院内信息 */ | |
| 1545 | - map.put("lastMenses", DateUtil.getyyyy_MM_dd(data.getLastMenses())); | |
| 1546 | - //TODO 纠正末次月经 | |
| 1547 | - map.put("dueDate", DateUtil.getyyyy_MM_dd(data.getDueDate())); | |
| 1548 | - map.put("vcCardNo", data.getVcCardNo()); | |
| 1549 | - //TODO 条码 | |
| 1550 | - //TODO 档案编号 | |
| 1551 | - map.put("mremark", data.getMremark()); | |
| 1552 | - //TODO 服务类型 | |
| 1553 | - map.put("serviceStatus", ServiceStatusEnums.getNameById(data.getServiceStatus())); | |
| 1554 | - | |
| 1555 | - br.setData(map); | |
| 1556 | - br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1557 | - br.setErrormsg("成功"); | |
| 1558 | - return br; | |
| 1559 | - } | |
| 1560 | 1492 | |
| 1561 | 1493 | |
| 1562 | 1494 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
8248863
| ... | ... | @@ -1639,386 +1639,6 @@ |
| 1639 | 1639 | return newBabyManagerResult; |
| 1640 | 1640 | } |
| 1641 | 1641 | |
| 1642 | - @Autowired | |
| 1643 | - private CommonService commonService; | |
| 1644 | - | |
| 1645 | - public BaseObjectResponse findMatDeliverData(String id){ | |
| 1646 | - | |
| 1647 | - BaseObjectResponse br = new BaseObjectResponse(); | |
| 1648 | - | |
| 1649 | - if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 1650 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1651 | - br.setErrormsg("id为空"); | |
| 1652 | - return br; | |
| 1653 | - } | |
| 1654 | - | |
| 1655 | - MaternalDeliverModel data = matDeliverService.getOneMatDeliver(id); | |
| 1656 | - if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 1657 | - br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 1658 | - br.setErrormsg("没有查询到数据"); | |
| 1659 | - return br; | |
| 1660 | - } | |
| 1661 | - | |
| 1662 | - /* 基本信息 */ | |
| 1663 | - if (StringUtils.isEmpty(data.getParentId())){ | |
| 1664 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1665 | - br.setErrormsg("数据异常"); | |
| 1666 | - return br; | |
| 1667 | - } | |
| 1668 | - | |
| 1669 | - Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 1670 | - | |
| 1671 | - if (patients==null){ | |
| 1672 | - br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1673 | - br.setErrormsg("数据异常"); | |
| 1674 | - return br; | |
| 1675 | - } | |
| 1676 | - | |
| 1677 | - Map<String,Object> map= new HashMap<>(); | |
| 1678 | - map.put("id",data.getId()); | |
| 1679 | - map.put("username",patients.getUsername()); | |
| 1680 | - map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 1681 | - map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 1682 | - map.put("phone",patients.getPhone()); | |
| 1683 | - map.put("fmWeek",patients.getFmWeek()); | |
| 1684 | - map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 1685 | - map.put("mremark",patients.getMremark()); | |
| 1686 | - | |
| 1687 | - String riskFactor = ""; | |
| 1688 | - if (StringUtils.isNotEmpty(patients.getoRiskFactor())){ | |
| 1689 | - riskFactor = patients.getoRiskFactor(); | |
| 1690 | - } | |
| 1691 | - | |
| 1692 | - if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ | |
| 1693 | - if (StringUtils.isEmpty(riskFactor)){ | |
| 1694 | - riskFactor = commonService.resloveFactor(patients.getRiskFactorId()); | |
| 1695 | - }else { | |
| 1696 | - riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId()); | |
| 1697 | - } | |
| 1698 | - } | |
| 1699 | - map.put("oRiskFactor",riskFactor); | |
| 1700 | - | |
| 1701 | - String riskLevel = ""; | |
| 1702 | - | |
| 1703 | - if (StringUtils.isNotEmpty(patients.getRiskLevelId())){ | |
| 1704 | - List<String> riskLevels = JsonUtil.toList(patients.getRiskLevelId(), String.class); | |
| 1705 | - if (CollectionUtils.isNotEmpty(riskLevels)){ | |
| 1706 | - StringBuilder sb = new StringBuilder(); | |
| 1707 | - for (String r : riskLevels){ | |
| 1708 | - sb.append(FunvCommonUtil.getBaseicConfigByid(r, basicConfigService)).append(","); | |
| 1709 | - } | |
| 1710 | - | |
| 1711 | - if (sb.toString().endsWith(",")){ | |
| 1712 | - riskLevel = sb.substring(0, sb.length() - 1); | |
| 1713 | - }else { | |
| 1714 | - riskLevel = sb.toString(); | |
| 1715 | - } | |
| 1716 | - | |
| 1717 | - } | |
| 1718 | - } | |
| 1719 | - map.put("riskLevel", riskLevel); | |
| 1720 | - map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(), UnitConstants.FEN)); | |
| 1721 | - | |
| 1722 | - map.put("deliveryDate", data.getDueDate()); | |
| 1723 | - map.put("dueWeek", data.getDueWeek()); | |
| 1724 | - | |
| 1725 | - String fmHospital = ""; | |
| 1726 | - | |
| 1727 | - if (StringUtils.isNotEmpty(data.getFmHospital())){ | |
| 1728 | - Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); | |
| 1729 | - if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 1730 | - fmHospital = organization.getName(); | |
| 1731 | - } | |
| 1732 | - } | |
| 1733 | - | |
| 1734 | - map.put("fmHospital", fmHospital); | |
| 1735 | - | |
| 1736 | - String deliverDoctor = ""; | |
| 1737 | - | |
| 1738 | - if (StringUtils.isNotEmpty(data.getDeliverDoctor())){ | |
| 1739 | - Users users = usersService.getUsers(Integer.parseInt(data.getDeliverDoctor())); | |
| 1740 | - if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 1741 | - deliverDoctor = users.getName(); | |
| 1742 | - } | |
| 1743 | - } | |
| 1744 | - | |
| 1745 | - map.put("deliverDoctor", deliverDoctor); | |
| 1746 | - | |
| 1747 | - /* 分娩信息 */ | |
| 1748 | - map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber() + ""));//胎数 | |
| 1749 | - map.put("placenta", UnitUtils.unitSplice(data.getPlacenta(),UnitConstants.GE));//胎盘 | |
| 1750 | - | |
| 1751 | - List<Map<String,Object>> placetaList = new ArrayList<>(); | |
| 1752 | - | |
| 1753 | - if (CollectionUtils.isNotEmpty(data.getPlacentas())){ | |
| 1754 | - @SuppressWarnings("unchecked") | |
| 1755 | - List<MatDeliverAddRequest.Placenta> placentas = data.getPlacentas(); | |
| 1756 | - if (CollectionUtils.isNotEmpty(placentas)){ | |
| 1757 | - for (Object obj : placentas) { | |
| 1758 | - | |
| 1759 | - String fetalPosition = ""; | |
| 1760 | - String fetalPresentation = ""; | |
| 1761 | - String heartRate = ""; | |
| 1762 | - | |
| 1763 | - if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { | |
| 1764 | - //转换类型 | |
| 1765 | - MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; | |
| 1766 | - //胎方位 | |
| 1767 | - if (StringUtils.isNotEmpty(placenta.getFetalPosition())) { | |
| 1768 | - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 1769 | - if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { | |
| 1770 | - fetalPosition += fetalPositionEnums.getName(); | |
| 1771 | - break; | |
| 1772 | - } | |
| 1773 | - } | |
| 1774 | - } | |
| 1775 | - //胎先露 | |
| 1776 | - fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation(); | |
| 1777 | - //胎心率 | |
| 1778 | - heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString(); | |
| 1779 | - | |
| 1780 | - } | |
| 1781 | - | |
| 1782 | - if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { | |
| 1783 | - Map<String, String> placenta = JsonUtil.getMap(obj.toString()); | |
| 1784 | - if (MapUtils.isNotEmpty(placenta)) { | |
| 1785 | - if (placenta.get("fetalPosition") != null) { | |
| 1786 | - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 1787 | - if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { | |
| 1788 | - fetalPosition += fetalPositionEnums.getName(); | |
| 1789 | - break; | |
| 1790 | - } | |
| 1791 | - } | |
| 1792 | - } | |
| 1793 | - heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate"); | |
| 1794 | - fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation"); | |
| 1795 | - } | |
| 1796 | - } | |
| 1797 | - Map<String,Object> placetaMap = new HashMap<>(); | |
| 1798 | - placetaMap.put("fetalPosition",fetalPosition); | |
| 1799 | - placetaMap.put("fetalPresentation",fetalPresentation); | |
| 1800 | - placetaMap.put("heartRate",UnitUtils.unitSplice(heartRate,UnitConstants.CIFEN)); | |
| 1801 | - placetaList.add(placetaMap); | |
| 1802 | - } | |
| 1803 | - } | |
| 1804 | - } | |
| 1805 | - | |
| 1806 | - map.put("placentaData", placetaList);//胎盘信息 | |
| 1807 | - | |
| 1808 | - String deliveryMode = ""; | |
| 1809 | - if (StringUtils.isNotEmpty(data.getDeliveryMode())){ | |
| 1810 | - | |
| 1811 | - StringBuilder sb = new StringBuilder(); | |
| 1812 | - | |
| 1813 | - Map m = JsonUtil.str2Obj(data.getDeliveryMode(),Map.class); | |
| 1814 | - String fmfs = null; | |
| 1815 | - if (m!=null){ | |
| 1816 | - Object b = m.get("fmfs"); | |
| 1817 | - if (b!=null){ | |
| 1818 | - fmfs = b.toString(); | |
| 1819 | - if (fmfs!=null){ | |
| 1820 | - if (fmfs.equals("1")){ | |
| 1821 | - String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 1822 | - sb.append(fmName).append(","); | |
| 1823 | - String scfs = m.get("scfs").toString(); | |
| 1824 | - sb.append(FmTypeEnums.getFmScNameById(scfs)); | |
| 1825 | - deliveryMode = sb.toString(); | |
| 1826 | - }else if (fmfs.equals("2")){ | |
| 1827 | - String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 1828 | - deliveryMode = fmName; | |
| 1829 | - } | |
| 1830 | - } | |
| 1831 | - } | |
| 1832 | - } | |
| 1833 | - } | |
| 1834 | - map.put("deliveryMode", deliveryMode);//分娩方式 | |
| 1835 | - map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause()); | |
| 1836 | - | |
| 1837 | - findProcess(data.getProdprocess(), map);//1,2,3产程 | |
| 1838 | - findTotalProcess(data.getTotalprocess(),map);//总产程 | |
| 1839 | - | |
| 1840 | - map.put("perinealCondition", FunvCommonUtil.checkHuiYin(data.getPerinealCondition())); | |
| 1841 | - | |
| 1842 | - map.put("siLielevel", FunvCommonUtil.checkSiLieLevel(data.getSiLielevel())); | |
| 1843 | - | |
| 1844 | - map.put("needleNum", UnitUtils.unitSplice(data.getNeedleNum(),UnitConstants.ZHEN)); | |
| 1845 | - | |
| 1846 | - /* 产后生理 */ | |
| 1847 | - map.put("maternalInfo", data.getMaternalInfo()); | |
| 1848 | - map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause()); | |
| 1849 | - // 产后血压 收缩压,舒张压 | |
| 1850 | - String ssy = ""; | |
| 1851 | - String szy = ""; | |
| 1852 | - Map<String, String> chBpMap = JsonUtil.getMap(data.getChBp()); | |
| 1853 | - if (MapUtils.isNotEmpty(chBpMap)) { | |
| 1854 | - ssy = chBpMap.get("ssy"); | |
| 1855 | - szy = chBpMap.get("szy"); | |
| 1856 | - } | |
| 1857 | - map.put("ssy", UnitUtils.unitSplice(ssy,UnitConstants.MMHG)); | |
| 1858 | - map.put("szy", UnitUtils.unitSplice(szy,UnitConstants.MMHG)); | |
| 1859 | - // 产后2小时血压 收缩压,舒张压 | |
| 1860 | - String ssy2h = ""; | |
| 1861 | - String szy2h = ""; | |
| 1862 | - Map<String, String> ch2BpMap = JsonUtil.getMap(data.getCh2Bp()); | |
| 1863 | - if (MapUtils.isNotEmpty(ch2BpMap)) { | |
| 1864 | - ssy2h = ch2BpMap.get("ssy"); | |
| 1865 | - szy2h = ch2BpMap.get("szy"); | |
| 1866 | - } | |
| 1867 | - map.put("ssy2h",UnitUtils.unitSplice(ssy2h,UnitConstants.MMHG)); | |
| 1868 | - map.put("szy2h", UnitUtils.unitSplice(szy2h,UnitConstants.MMHG)); | |
| 1869 | - | |
| 1870 | - map.put("breath", UnitUtils.unitSplice(data.getBreath(),UnitConstants.CIFEN)); | |
| 1871 | - map.put("pulse", UnitUtils.unitSplice(data.getPulse(), UnitConstants.CIFEN)); | |
| 1872 | - | |
| 1873 | - map.put("oHloseBloodL", UnitUtils.unitSplice(data.getoHloseBloodL(),UnitConstants.ML)); | |
| 1874 | - map.put("tHloseBloodL", UnitUtils.unitSplice(data.gettHloseBloodL(),UnitConstants.ML)); | |
| 1875 | - map.put("rHloseBloodL", UnitUtils.unitSplice(data.getrHloseBloodL(),UnitConstants.ML)); | |
| 1876 | - map.put("sHloseBloodL", UnitUtils.unitSplice(data.getsHloseBloodL(),UnitConstants.ML)); | |
| 1877 | - | |
| 1878 | - String loseBloodCause = ""; | |
| 1879 | - if (StringUtils.isNotEmpty(data.getLoseBloodCause())){ | |
| 1880 | - String loseBloodCauseJson = data.getLoseBloodCause(); | |
| 1881 | - Map<String, String> loseBloodCauseMap = JsonUtil.getMap(loseBloodCauseJson); | |
| 1882 | - if (MapUtils.isNotEmpty(loseBloodCauseMap) && StringUtils.isNotEmpty(loseBloodCauseMap.get("select"))) { | |
| 1883 | - for (SXCauseEnums sxCauseEnums : SXCauseEnums.values()) { | |
| 1884 | - if (sxCauseEnums.getId().equals(loseBloodCauseMap.get("select"))) { | |
| 1885 | - loseBloodCause = sxCauseEnums.getName(); | |
| 1886 | - } | |
| 1887 | - } | |
| 1888 | - if (SXCauseEnums.O5.getName().equals(data.getLoseBloodCause()) && StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) { | |
| 1889 | - loseBloodCause = loseBloodCauseMap.get("other"); | |
| 1890 | - } | |
| 1891 | - } | |
| 1892 | - } | |
| 1893 | - map.put("loseBloodCause", loseBloodCause); | |
| 1894 | - | |
| 1895 | - //产科并发症(需要解析) | |
| 1896 | - map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(),Map.class))); | |
| 1897 | - | |
| 1898 | - /* 胎盘及新生儿信息 */ | |
| 1899 | - | |
| 1900 | - //胎盘信息 | |
| 1901 | - List<Map<String,Object>> ExtPlacentaList = new ArrayList<>(); | |
| 1902 | - | |
| 1903 | - if (CollectionUtils.isNotEmpty(data.getExtPlacentas())){ | |
| 1904 | - for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){ | |
| 1905 | - Map<String,Object> extMap = new HashMap<>(); | |
| 1906 | - extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType())); | |
| 1907 | - extMap.put("mcType", FunvCommonUtil.checkMianChuFS(temp.getMcType())); | |
| 1908 | - String tpSize = ""; | |
| 1909 | - tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + UnitConstants.CM; | |
| 1910 | - extMap.put("tpSize",tpSize); | |
| 1911 | - extMap.put("tpWeight",UnitUtils.unitSplice(temp.getTpWeight(),UnitConstants.G)); | |
| 1912 | - extMap.put("umbilicalCordLength",UnitUtils.unitSplice(temp.getUmbilicalCordLength(),UnitConstants.CM)); | |
| 1913 | - | |
| 1914 | - String umbilicalCordEx = ""; | |
| 1915 | - String umbilicalCordExType = ""; | |
| 1916 | - | |
| 1917 | - if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())){ | |
| 1918 | - if (temp.getUmbilicalCordEx().equals("no")){ | |
| 1919 | - umbilicalCordEx = "无"; | |
| 1920 | - }else if (temp.getUmbilicalCordEx().equals("yes")){ | |
| 1921 | - umbilicalCordEx = "有"; | |
| 1922 | - if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())){ | |
| 1923 | - for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()){ | |
| 1924 | - if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())){ | |
| 1925 | - umbilicalCordExType = qiDaiEnums.getName(); | |
| 1926 | - } | |
| 1927 | - } | |
| 1928 | - } | |
| 1929 | - } | |
| 1930 | - } | |
| 1931 | - extMap.put("umbilicalCordEx",umbilicalCordEx); | |
| 1932 | - extMap.put("umbilicalCordExType",umbilicalCordExType); | |
| 1933 | - | |
| 1934 | - ExtPlacentaList.add(extMap); | |
| 1935 | - } | |
| 1936 | - } | |
| 1937 | - map.put("extPlacentas", ExtPlacentaList); | |
| 1938 | - | |
| 1939 | - //新生儿信息 | |
| 1940 | - | |
| 1941 | - List<Map<String,Object>> babyList = new ArrayList<>(); | |
| 1942 | - | |
| 1943 | - if (CollectionUtils.isNotEmpty(data.getBaby())){ | |
| 1944 | - for (MaternalDeliverModel.Baby temp : data.getBaby()){ | |
| 1945 | - Map<String,Object> babyMap = new HashMap<>(); | |
| 1946 | - babyMap.put("dueTime",temp.getDueTime()); | |
| 1947 | - babyMap.put("pregnancyOut",temp.getPregnancyOut()); | |
| 1948 | - babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); | |
| 1949 | - babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( | |
| 1950 | - Integer.parseInt(temp.getBabyGender()))); | |
| 1951 | - babyMap.put("babyWeight", UnitUtils.unitSplice(temp.getBabyWeight(),UnitConstants.G)); | |
| 1952 | - babyMap.put("babyHeight", UnitUtils.unitSplice(temp.getBabyHeight(),UnitConstants.CM)); | |
| 1953 | - babyMap.put("babyHealthy",temp.getBabyHealthy()); | |
| 1954 | - String apgarScorePf1 = ""; | |
| 1955 | - String apgarScorePf5 = ""; | |
| 1956 | - String apgarScorePf10 = ""; | |
| 1957 | - Map<String, String> m = JsonUtil.getMap(temp.getApgarScore()); | |
| 1958 | - if (MapUtils.isNotEmpty(map)) { | |
| 1959 | - apgarScorePf1 += m.get("pf1") == null ? "" : (m.get("pf1") + "*"); | |
| 1960 | - apgarScorePf5 += m.get("pf5") == null ? "" : (m.get("pf5") + "*"); | |
| 1961 | - apgarScorePf10 += m.get("pf10") == null ? "" : m.get("pf10"); | |
| 1962 | - } | |
| 1963 | - babyMap.put("apgarScore", UnitUtils.unitSplice(apgarScorePf1 + apgarScorePf5 + apgarScorePf10,UnitConstants.FEN)); | |
| 1964 | - babyMap.put("asphyxiaM",UnitUtils.unitSplice(temp.getAsphyxiaM(),UnitConstants.FZ)); | |
| 1965 | - babyMap.put("contactStartM",UnitUtils.unitSplice(temp.getContactStartM(),UnitConstants.FZ)); | |
| 1966 | - babyMap.put("contactM",UnitUtils.unitSplice(temp.getContactM(),UnitConstants.FZ)); | |
| 1967 | - babyMap.put("earlySuck",temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); | |
| 1968 | - | |
| 1969 | - babyList.add(babyMap); | |
| 1970 | - } | |
| 1971 | - } | |
| 1972 | - | |
| 1973 | - map.put("baby", babyList); | |
| 1974 | - | |
| 1975 | - br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1976 | - br.setErrormsg("成功"); | |
| 1977 | - br.setData(map); | |
| 1978 | - return br; | |
| 1979 | - } | |
| 1980 | - | |
| 1981 | - //总产程 | |
| 1982 | - public static Map<String,Object> findTotalProcess(String totalProcess,Map<String,Object> map){ | |
| 1983 | - | |
| 1984 | - String p = ""; | |
| 1985 | - | |
| 1986 | - Map<String, String> totalprocessMap = JsonUtil.getMap(totalProcess); | |
| 1987 | - if (MapUtils.isNotEmpty(totalprocessMap)) { | |
| 1988 | - p = totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"; | |
| 1989 | - } | |
| 1990 | - map.put("totalProcess",p); | |
| 1991 | - return map; | |
| 1992 | - | |
| 1993 | - } | |
| 1994 | - | |
| 1995 | - //解析1,2,3产程 | |
| 1996 | - public static Map<String,Object> findProcess(String process,Map<String,Object> map){ | |
| 1997 | -// process = "{\"one\":{\"h\":4,\"m\":20},\"two\":{\"m\":53},\"three\":{\"m\":7}}"; | |
| 1998 | - String one = ""; | |
| 1999 | - String two = ""; | |
| 2000 | - String three = ""; | |
| 2001 | - Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(process); | |
| 2002 | - if (MapUtils.isNotEmpty(prodprocessMap)) { | |
| 2003 | - Map<String, String> prodprocessOne = prodprocessMap.get("one"); | |
| 2004 | - if (MapUtils.isNotEmpty(prodprocessOne)) { | |
| 2005 | - one = prodprocessOne.get("h") + "时" + prodprocessOne.get("m") + "分"; | |
| 2006 | - } | |
| 2007 | - Map<String, String> prodprocessTwo = prodprocessMap.get("two"); | |
| 2008 | - if (MapUtils.isNotEmpty(prodprocessTwo)) { | |
| 2009 | - two = prodprocessOne.get("h") + "时" + prodprocessTwo.get("m") + "分"; | |
| 2010 | - } | |
| 2011 | - Map<String, String> prodprocessThree = prodprocessMap.get("three"); | |
| 2012 | - if (MapUtils.isNotEmpty(prodprocessThree)) { | |
| 2013 | - three = prodprocessOne.get("h") + "时" + prodprocessThree.get("m") + "分"; | |
| 2014 | - } | |
| 2015 | - } | |
| 2016 | - map.put("one",one); | |
| 2017 | - map.put("two",two); | |
| 2018 | - map.put("three",three); | |
| 2019 | - return map; | |
| 2020 | - } | |
| 2021 | - | |
| 2022 | 1642 | |
| 2023 | 1643 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
8248863
| 1 | +package com.lyms.platform.operate.web.facade; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.*; | |
| 4 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 5 | +import com.lyms.platform.common.enums.*; | |
| 6 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 7 | +import com.lyms.platform.common.utils.DateUtil; | |
| 8 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 9 | +import com.lyms.platform.operate.web.request.MatDeliverAddRequest; | |
| 10 | +import com.lyms.platform.operate.web.utils.*; | |
| 11 | +import com.lyms.platform.permission.model.Organization; | |
| 12 | +import com.lyms.platform.permission.model.Users; | |
| 13 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 14 | +import com.lyms.platform.permission.service.UsersService; | |
| 15 | +import com.lyms.platform.pojo.*; | |
| 16 | +import org.apache.commons.collections.CollectionUtils; | |
| 17 | +import org.apache.commons.collections.MapUtils; | |
| 18 | +import org.apache.commons.lang.StringUtils; | |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | +import org.springframework.stereotype.Component; | |
| 21 | + | |
| 22 | +import java.util.ArrayList; | |
| 23 | +import java.util.HashMap; | |
| 24 | +import java.util.List; | |
| 25 | +import java.util.Map; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * Created by Administrator on 2017/1/16 0016. | |
| 29 | + */ | |
| 30 | +@Component | |
| 31 | +public class ViewFacade { | |
| 32 | + @Autowired | |
| 33 | + private BasicConfigService basicConfigService; | |
| 34 | + @Autowired | |
| 35 | + private AntenatalExaminationService antExService; | |
| 36 | + @Autowired | |
| 37 | + private PatientsService patientsService; | |
| 38 | + @Autowired | |
| 39 | + private UsersService usersService; | |
| 40 | + @Autowired | |
| 41 | + private OrganizationService organizationService; | |
| 42 | + @Autowired | |
| 43 | + private CommonService commonService; | |
| 44 | + @Autowired | |
| 45 | + private MatDeliverService matDeliverService; | |
| 46 | + | |
| 47 | + | |
| 48 | + public BaseObjectResponse findPatientData(String id) { | |
| 49 | + | |
| 50 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 51 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)) { | |
| 52 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 53 | + br.setErrormsg("id为空"); | |
| 54 | + return br; | |
| 55 | + } | |
| 56 | + | |
| 57 | + Patients data = patientsService.findOnePatientById(id); | |
| 58 | + if (data == null || data.getYn() == YnEnums.NO.getId()) { | |
| 59 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 60 | + br.setErrormsg("没有查询到数据"); | |
| 61 | + return br; | |
| 62 | + } | |
| 63 | + | |
| 64 | + Map<String, Object> map = new HashMap<>(); | |
| 65 | + map.put("id", data.getId()); | |
| 66 | + /* 孕妇基础数据 */ | |
| 67 | + map.put("username", data.getUsername()); | |
| 68 | + map.put("pcerteType", getBasicConfig(data.getPcerteTypeId())); | |
| 69 | + map.put("cardNo", data.getCardNo()); | |
| 70 | + map.put("pcountry", getBasicConfig(data.getPcountryId())); | |
| 71 | + map.put("pnation", getBasicConfig(data.getPnationId())); | |
| 72 | + map.put("birth", DateUtil.getyyyy_MM_dd(data.getBirth())); | |
| 73 | + map.put("age", DateUtil.getAge(data.getBirth())); | |
| 74 | + map.put("pcensusType", getBasicConfig(data.getPcensusTypeId())); | |
| 75 | + map.put("pliveType", getBasicConfig(data.getPliveTypeId())); | |
| 76 | + map.put("pprofessionType", getBasicConfig(data.getPprofessionTypeId())); | |
| 77 | + map.put("plevelType", getBasicConfig(data.getPlevelTypeId())); | |
| 78 | + //TODO 家庭人均收入 | |
| 79 | + | |
| 80 | + /* 孕妇联系方式 */ | |
| 81 | + map.put("residence", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 82 | + data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 83 | + map.put("register", CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(), | |
| 84 | + data.getAreaRegisterId(), data.getStreetRegisterId(), data.getAddressRegister(), basicConfigService)); | |
| 85 | + map.put("postRest", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 86 | + data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 87 | + | |
| 88 | + /* 丈夫信息 */ | |
| 89 | + map.put("husbandName", data.getHusbandName()); | |
| 90 | + map.put("hcertificateType", getBasicConfig(data.getHcertificateTypeId())); | |
| 91 | + map.put("hcertificateNum", data.getHcertificateNum()); | |
| 92 | + map.put("hcountry", getBasicConfig(data.getHcountryId())); | |
| 93 | + map.put("hnation", getBasicConfig(data.getHnationId())); | |
| 94 | + map.put("husbandPhone", data.getHusbandPhone()); | |
| 95 | + map.put("hprofessionType", getBasicConfig(data.getHprofessionTypeId())); | |
| 96 | + map.put("hworkUnit", data.getHworkUnit()); | |
| 97 | + map.put("hregister", CommonsHelper.getResidence(data.getHprovinceRegisterId(), data.getHcityRegisterId(), | |
| 98 | + data.getHareaRegisterId(), data.getHstreetRegisterId(), data.getHaddressRegister(), | |
| 99 | + basicConfigService)); | |
| 100 | + | |
| 101 | + /* 院内信息 */ | |
| 102 | + map.put("lastMenses", DateUtil.getyyyy_MM_dd(data.getLastMenses())); | |
| 103 | + //TODO 纠正末次月经 | |
| 104 | + map.put("dueDate", DateUtil.getyyyy_MM_dd(data.getDueDate())); | |
| 105 | + map.put("vcCardNo", data.getVcCardNo()); | |
| 106 | + //TODO 条码 | |
| 107 | + //TODO 档案编号 | |
| 108 | + map.put("mremark", data.getMremark()); | |
| 109 | + //TODO 服务类型 | |
| 110 | + map.put("serviceStatus", ServiceStatusEnums.getNameById(data.getServiceStatus())); | |
| 111 | + | |
| 112 | + br.setData(map); | |
| 113 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 114 | + br.setErrormsg("成功"); | |
| 115 | + return br; | |
| 116 | + } | |
| 117 | + | |
| 118 | + private String getBasicConfig(String id) { | |
| 119 | + if (com.lyms.platform.common.utils.StringUtils.isEmpty(id)) { | |
| 120 | + return ""; | |
| 121 | + } | |
| 122 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); | |
| 123 | + if (null != basicConfig) { | |
| 124 | + return basicConfig.getName(); | |
| 125 | + } | |
| 126 | + return ""; | |
| 127 | + } | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + public BaseObjectResponse findAntExChu(String id){ | |
| 132 | + | |
| 133 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 134 | + | |
| 135 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 136 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 137 | + br.setErrormsg("id为空"); | |
| 138 | + return br; | |
| 139 | + } | |
| 140 | + | |
| 141 | + AntExChuModel data = antExService.findOne(id); | |
| 142 | + if (data==null || data.getYn()== YnEnums.NO.getId()){ | |
| 143 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 144 | + br.setErrormsg("没有查询到数据"); | |
| 145 | + return br; | |
| 146 | + } | |
| 147 | + | |
| 148 | + | |
| 149 | + if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())){ | |
| 150 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 151 | + br.setErrormsg("数据异常"); | |
| 152 | + return br; | |
| 153 | + } | |
| 154 | + | |
| 155 | + Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 156 | + if (patients==null || patients.getYn()==YnEnums.NO.getId()){ | |
| 157 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 158 | + br.setErrormsg("孕妇信息不存在"); | |
| 159 | + return br; | |
| 160 | + } | |
| 161 | + | |
| 162 | + Map<String,Object> map= new HashMap<>(); | |
| 163 | + /* 基本信息 */ | |
| 164 | + //孕妇基本信息 | |
| 165 | + map.put("id",data.getId()); | |
| 166 | + map.put("username",patients.getUsername()); | |
| 167 | + map.put("birth", DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 168 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 169 | + map.put("phone",patients.getPhone()); | |
| 170 | + map.put("fmWeek",patients.getFmWeek()); | |
| 171 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 172 | + map.put("mremark",patients.getMremark()); | |
| 173 | + map.put("oRiskFactor",patients.getoRiskFactor());//TODO 高危需要处理 | |
| 174 | + map.put("riskScore",patients.getRiskScore()); | |
| 175 | + //产检基本信息 | |
| 176 | + map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckTime())); | |
| 177 | + //TODO 产检孕周 | |
| 178 | + String checkDoctor = ""; | |
| 179 | + | |
| 180 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getProdDoctor())){ | |
| 181 | + Users users = usersService.getUsers(Integer.parseInt(data.getProdDoctor())); | |
| 182 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 183 | + checkDoctor = users.getName(); | |
| 184 | + } | |
| 185 | + } | |
| 186 | + map.put("checkDoctor", checkDoctor); | |
| 187 | + String hospital = ""; | |
| 188 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 189 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
| 190 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 191 | + hospital = organization.getName(); | |
| 192 | + } | |
| 193 | + } | |
| 194 | + map.put("hospital", hospital); | |
| 195 | + map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
| 196 | + map.put("cDueWeek", data.getcDueWeek()); | |
| 197 | + | |
| 198 | + /* 初诊信息 */ | |
| 199 | + //既往史 | |
| 200 | + String pastHistory = ""; | |
| 201 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPastHistory())){ | |
| 202 | + Map map1 = JsonUtil.jkstr2Obj(data.getPastHistory(), Map.class); | |
| 203 | + pastHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); | |
| 204 | + } | |
| 205 | + map.put("pastHistory", pastHistory); | |
| 206 | + //家族史 | |
| 207 | + String familyHistory = ""; | |
| 208 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getFamilyHistory())){ | |
| 209 | + Map map1 = JsonUtil.jkstr2Obj(data.getFamilyHistory(),Map.class); | |
| 210 | + familyHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 211 | + } | |
| 212 | + map.put("familyHistory", familyHistory); | |
| 213 | + //个人史 | |
| 214 | + String personalHistory = ""; | |
| 215 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPersonalHistory())){ | |
| 216 | + Map map1 = JsonUtil.jkstr2Obj(data.getPersonalHistory(),Map.class); | |
| 217 | + personalHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 218 | + } | |
| 219 | + map.put("personalHistory", personalHistory); | |
| 220 | + //疫苗接种史 | |
| 221 | + String ymjzHistory = ""; | |
| 222 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYmjzHistory())){ | |
| 223 | + Map map1 = JsonUtil.jkstr2Obj(data.getYmjzHistory(),Map.class); | |
| 224 | + ymjzHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 225 | + } | |
| 226 | + map.put("ymjzHistory", ymjzHistory); | |
| 227 | + //药物过敏史 | |
| 228 | + String ywgmHistory = ""; | |
| 229 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYwgmHistory())){ | |
| 230 | + Map map1 = JsonUtil.jkstr2Obj(data.getYwgmHistory(),Map.class); | |
| 231 | + ywgmHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 232 | + } | |
| 233 | + map.put("ywgmHistory", ywgmHistory); | |
| 234 | + //妇科手术史 | |
| 235 | + String fksxHistory = ""; | |
| 236 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getFksxHistory())){ | |
| 237 | + Map map1 = JsonUtil.jkstr2Obj(data.getFksxHistory(),Map.class); | |
| 238 | + fksxHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 239 | + } | |
| 240 | + map.put("fksxHistory", fksxHistory); | |
| 241 | + //叶酸服用 | |
| 242 | + String ysfyHistory = ""; | |
| 243 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYsfyHistory())){ | |
| 244 | + Map map1 = JsonUtil.jkstr2Obj(data.getYsfyHistory(),Map.class); | |
| 245 | + ysfyHistory = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 246 | + } | |
| 247 | + map.put("ysfyHistory", ysfyHistory); | |
| 248 | + //本次妊娠情况 | |
| 249 | + String cestationInfo = ""; | |
| 250 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getCestationInfo())){ | |
| 251 | + Map map1 = JsonUtil.jkstr2Obj(data.getCestationInfo(),Map.class); | |
| 252 | + cestationInfo = FunvCommonUtil.replace(map1,new StringBuilder(),basicConfigService); | |
| 253 | + } | |
| 254 | + map.put("cestationInfo", cestationInfo); | |
| 255 | + | |
| 256 | + //孕产史 | |
| 257 | + map.put("pregnancyTimes", UnitUtils.unitSplice(data.getPregnancyTimes(), UnitConstants.CI)); | |
| 258 | + map.put("prodTime", UnitUtils.unitSplice(data.getProdTime(),UnitConstants.CI)); | |
| 259 | + map.put("delivery", UnitUtils.unitSplice(data.getDelivery(),UnitConstants.CI)); | |
| 260 | + map.put("planedProd", UnitUtils.unitSplice(data.getPlanedProd(),UnitConstants.CI)); | |
| 261 | + map.put("abortion", UnitUtils.unitSplice(data.getAbortion(),UnitConstants.CI)); | |
| 262 | + map.put("stillbirth", UnitUtils.unitSplice(data.getStillbirth(),UnitConstants.CI)); | |
| 263 | + map.put("stillChan", UnitUtils.unitSplice(data.getStillChan(),UnitConstants.CI)); | |
| 264 | + map.put("neoDeath", UnitUtils.unitSplice(data.getNeoDeath(),UnitConstants.CI)); | |
| 265 | + map.put("birthDefect", UnitUtils.unitSplice(data.getBirthDefect(),UnitConstants.CI)); | |
| 266 | + | |
| 267 | + map.put("height", UnitUtils.unitSplice(data.getHeight(),UnitConstants.CM)); | |
| 268 | + map.put("weight", UnitUtils.unitSplice(data.getWeight(),UnitConstants.KG)); | |
| 269 | + map.put("yqWeight", UnitUtils.unitSplice(data.getYqWeight(),UnitConstants.KG)); | |
| 270 | + // 血压 | |
| 271 | + String ssy = ""; | |
| 272 | + String szy = ""; | |
| 273 | + Map<String, String> chBpMap = JsonUtil.getMap(data.getBp()); | |
| 274 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
| 275 | + ssy = chBpMap.get("ssy"); | |
| 276 | + szy = chBpMap.get("szy"); | |
| 277 | + } | |
| 278 | + map.put("bp", UnitUtils.unitSplice(ssy + "/" + szy, UnitConstants.MMHG)); | |
| 279 | + | |
| 280 | + map.put("heart", data.getHeart()); | |
| 281 | + map.put("lungs", data.getLungs()); | |
| 282 | + map.put("vulva", data.getVulva()); | |
| 283 | + map.put("vagina", data.getVagina()); | |
| 284 | + map.put("cervical", data.getCervical()); | |
| 285 | + map.put("uterus", data.getUterus()); | |
| 286 | + map.put("fujian", data.getFujian()); | |
| 287 | + | |
| 288 | + map.put("gonggao", UnitUtils.unitSplice(data.getGonggao(),UnitConstants.CM)); | |
| 289 | + map.put("fuwei", UnitUtils.unitSplice(data.getFuwei(),UnitConstants.CM)); | |
| 290 | + map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); | |
| 291 | + //胎儿情况 | |
| 292 | + List<Map> placentas = new ArrayList<>(); | |
| 293 | + if (CollectionUtils.isNotEmpty(data.getPlacentas())){ | |
| 294 | + for (Object temp : data.getPlacentas()){ | |
| 295 | + Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
| 296 | + String heartRate = tire.get("heartRate"); | |
| 297 | + String fetalPosition = tire.get("fetalPosition"); | |
| 298 | + String fetalPresentation = tire.get("fetalPresentation"); | |
| 299 | + String join = tire.get("join"); | |
| 300 | + | |
| 301 | + Map<String,Object> tireMap = new HashMap<>(); | |
| 302 | + tireMap.put("heartRate",UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 303 | + tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); | |
| 304 | + tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); | |
| 305 | + tireMap.put("join", JoinEnums.getTitle(join)); | |
| 306 | + placentas.add(tireMap); | |
| 307 | + } | |
| 308 | + } | |
| 309 | + map.put("placentas",placentas); | |
| 310 | + | |
| 311 | + /* 辅助检查 */ | |
| 312 | + map.put("xhdb",UnitUtils.unitSplice(data.getXhdb(),UnitConstants.GL)); | |
| 313 | + map.put("bxbjs",UnitUtils.unitSplice(data.getBxbjs(),UnitConstants.TEN_LKG)); | |
| 314 | + map.put("platelet",UnitUtils.unitSplice(data.getPlatelet(),UnitConstants.TEN_LKG)); | |
| 315 | + map.put("chgOther",data.getChgOther()); | |
| 316 | + | |
| 317 | + map.put("ndb",data.getNdb()); | |
| 318 | + map.put("nt",data.getNt()); | |
| 319 | + map.put("urineKetone",data.getUrineKetone()); | |
| 320 | + map.put("bld",data.getBld()); | |
| 321 | + map.put("ncgOther",data.getNcgOther()); | |
| 322 | + | |
| 323 | + map.put("abo",FunvCommonUtil.getBaseicConfigByid(data.getAbo(), basicConfigService)); | |
| 324 | + map.put("rh",data.getRh()); | |
| 325 | + map.put("bloodSugar",data.getBloodSugar()); | |
| 326 | + map.put("xqgbzam",UnitUtils.unitSplice(data.getXqgbzam(), UnitConstants.UL)); | |
| 327 | + map.put("xqgczam",UnitUtils.unitSplice(data.getXqgczam(), UnitConstants.UL)); | |
| 328 | + map.put("albumin",UnitUtils.unitSplice(data.getAlbumin(), UnitConstants.GL)); | |
| 329 | + map.put("totalBilirubin",UnitUtils.unitSplice(data.getTotalBilirubin(), UnitConstants.UMOLL)); | |
| 330 | + map.put("jhBilirubin",UnitUtils.unitSplice(data.getJhBilirubin(), UnitConstants.UMOLL)); | |
| 331 | + map.put("bg",data.getBg()); | |
| 332 | + | |
| 333 | + map.put("ygbmky",FunvCommonUtil.checkYiGan(data.getYgbmky())); | |
| 334 | + map.put("ygbmkt",FunvCommonUtil.checkYiGan(data.getYgbmky())); | |
| 335 | + map.put("ygeky",FunvCommonUtil.checkYiGan(data.getYgeky())); | |
| 336 | + map.put("ygekt",FunvCommonUtil.checkYiGan(data.getYgekt())); | |
| 337 | + map.put("yghxkt",FunvCommonUtil.checkYiGan(data.getYghxkt())); | |
| 338 | + | |
| 339 | + map.put("xqjq",UnitUtils.unitSplice(data.getXqjq(), UnitConstants.UL)); | |
| 340 | + map.put("xnsd",UnitUtils.unitSplice(data.getXnsd(), UnitConstants.UL)); | |
| 341 | + | |
| 342 | + map.put("hivkt",FunvCommonUtil.checkYiGan(data.getHivkt())); | |
| 343 | + | |
| 344 | + String ydfmw = ""; | |
| 345 | + String ydqjd = ""; | |
| 346 | + | |
| 347 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getYdfmw())){ | |
| 348 | + Map ydfmwMap = JsonUtil.str2Obj(data.getYdfmw(), Map.class); | |
| 349 | + ydfmw = ResolveUtils.replaceYDFMW(ydfmwMap, 1); | |
| 350 | + ydqjd = ResolveUtils.replaceYDFMW(ydfmwMap,2); | |
| 351 | + } | |
| 352 | + | |
| 353 | + map.put("ydfmw",ydfmw); | |
| 354 | + map.put("ydqjd",ydqjd); | |
| 355 | + map.put("bChao",data.getbChao()); | |
| 356 | + | |
| 357 | + | |
| 358 | + /* 诊断指导 */ | |
| 359 | + String diagnosis = ""; | |
| 360 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())){ | |
| 361 | + List<String> temp = JsonUtil.toList(data.getDiagnosis(), String.class); | |
| 362 | + if (CollectionUtils.isNotEmpty(temp)){ | |
| 363 | + | |
| 364 | + StringBuilder sb = new StringBuilder(); | |
| 365 | + | |
| 366 | + for (String sId : temp){ | |
| 367 | + sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(","); | |
| 368 | + } | |
| 369 | + if (sb.toString().endsWith(",")) { | |
| 370 | + diagnosis = sb.substring(0, sb.length() - 1); | |
| 371 | + }else { | |
| 372 | + diagnosis = sb.toString(); | |
| 373 | + } | |
| 374 | + } | |
| 375 | + } | |
| 376 | + map.put("diagnosis",diagnosis); | |
| 377 | + map.put("treatOpinion",data.getTreatOpinion()); | |
| 378 | + map.put("dirOpinion",data.getDirOpinion()); | |
| 379 | + | |
| 380 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 381 | + br.setErrormsg("成功"); | |
| 382 | + br.setData(map); | |
| 383 | + | |
| 384 | + return br; | |
| 385 | + } | |
| 386 | + | |
| 387 | + //查询复诊接口 | |
| 388 | + public BaseObjectResponse findAntenatalExamination(String id){ | |
| 389 | + | |
| 390 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 391 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 392 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 393 | + br.setErrormsg("id为空"); | |
| 394 | + return br; | |
| 395 | + } | |
| 396 | + | |
| 397 | + AntenatalExaminationModel data = antExService.findOneById(id); | |
| 398 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 399 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 400 | + br.setErrormsg("没有查询到数据"); | |
| 401 | + return br; | |
| 402 | + } | |
| 403 | + | |
| 404 | + | |
| 405 | + if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())){ | |
| 406 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 407 | + br.setErrormsg("数据异常"); | |
| 408 | + return br; | |
| 409 | + } | |
| 410 | + | |
| 411 | + Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 412 | + if (patients==null || patients.getYn()==YnEnums.NO.getId()){ | |
| 413 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 414 | + br.setErrormsg("孕妇信息不存在"); | |
| 415 | + return br; | |
| 416 | + } | |
| 417 | + | |
| 418 | + Map<String,Object> map= new HashMap<>(); | |
| 419 | + /* 基本信息 */ | |
| 420 | + //孕妇基本信息 | |
| 421 | + map.put("id",data.getId()); | |
| 422 | + map.put("username",patients.getUsername()); | |
| 423 | + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 424 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 425 | + map.put("phone",patients.getPhone()); | |
| 426 | + map.put("fmWeek",patients.getFmWeek()); | |
| 427 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 428 | + map.put("mremark",patients.getMremark()); | |
| 429 | + map.put("oRiskFactor",patients.getoRiskFactor()); | |
| 430 | + map.put("riskScore",patients.getRiskScore()); | |
| 431 | + //产检基本信息 | |
| 432 | + map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate())); | |
| 433 | + map.put("currentDueDate",data.getCurrentDueDate()); | |
| 434 | + | |
| 435 | + String checkDoctor = ""; | |
| 436 | + | |
| 437 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getCheckDoctor())){ | |
| 438 | + Users users = usersService.getUsers(Integer.parseInt(data.getCheckDoctor())); | |
| 439 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 440 | + checkDoctor = users.getName(); | |
| 441 | + } | |
| 442 | + } | |
| 443 | + map.put("checkDoctor", checkDoctor); | |
| 444 | + | |
| 445 | + String hospital = ""; | |
| 446 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 447 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
| 448 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 449 | + hospital = organization.getName(); | |
| 450 | + } | |
| 451 | + } | |
| 452 | + map.put("hospital", hospital); | |
| 453 | + map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
| 454 | + map.put("cDueWeek", data.getcDueWeek()); | |
| 455 | + | |
| 456 | + /* 复诊信息 */ | |
| 457 | + map.put("chiefComplaint", data.getChiefComplaint()); | |
| 458 | + map.put("weight", UnitUtils.unitSplice(data.getWeight(), UnitConstants.KG)); | |
| 459 | + // 血压 | |
| 460 | + String ssy = ""; | |
| 461 | + String szy = ""; | |
| 462 | + Map<String, String> chBpMap = JsonUtil.getMap(data.getBp()); | |
| 463 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
| 464 | + ssy = chBpMap.get("ssy"); | |
| 465 | + szy = chBpMap.get("szy"); | |
| 466 | + } | |
| 467 | + map.put("bp", UnitUtils.unitSplice(ssy + "/" + szy, UnitConstants.MMHG)); | |
| 468 | + map.put("gongGao", UnitUtils.unitSplice(data.getGongGao(), UnitConstants.CM)); | |
| 469 | + map.put("abdominalCircumference", UnitUtils.unitSplice(data.getAbdominalCircumference(), UnitConstants.CM)); | |
| 470 | + String edema = ""; | |
| 471 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getEdema())){ | |
| 472 | + for (FuZhongEnums fuZhongEnums:FuZhongEnums.values()){ | |
| 473 | + if (data.getEdema().equals(fuZhongEnums.getId())){ | |
| 474 | + edema = fuZhongEnums.getName(); | |
| 475 | + } | |
| 476 | + } | |
| 477 | + } | |
| 478 | + map.put("edema",edema); | |
| 479 | + | |
| 480 | + map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); | |
| 481 | + //胎儿情况 | |
| 482 | + List<Map> tireList = new ArrayList<>(); | |
| 483 | + if (CollectionUtils.isNotEmpty(data.getTireData())){ | |
| 484 | + for (Object temp : data.getTireData()){ | |
| 485 | + Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
| 486 | + String heartRate = tire.get("heartRate"); | |
| 487 | + String fetalPosition = tire.get("fetalPosition"); | |
| 488 | + String fetalPresentation = tire.get("fetalPresentation"); | |
| 489 | + String join = tire.get("join"); | |
| 490 | + | |
| 491 | + Map<String,Object> tireMap = new HashMap<>(); | |
| 492 | + tireMap.put("heartRate",UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 493 | + tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); | |
| 494 | + tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); | |
| 495 | + tireMap.put("join", JoinEnums.getTitle(join)); | |
| 496 | + tireList.add(tireMap); | |
| 497 | + } | |
| 498 | + } | |
| 499 | + map.put("tireData",tireList); | |
| 500 | + | |
| 501 | + /* 辅助信息 */ | |
| 502 | + map.put("hemoglobin", UnitUtils.unitSplice(data.getHemoglobin(), UnitConstants.GL)); | |
| 503 | + map.put("urineProtein",data.getUrineProtein()); | |
| 504 | + map.put("bloodSugar", UnitUtils.unitSplice(data.getUrineProtein(), UnitConstants.MMOLL)); | |
| 505 | + map.put("bChao",data.getbChao()); | |
| 506 | + | |
| 507 | + /* 诊断指导 */ | |
| 508 | + String diagnosis = ""; | |
| 509 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())){ | |
| 510 | + List<String> temp = JsonUtil.toList(data.getDiagnosis(), String.class); | |
| 511 | + if (CollectionUtils.isNotEmpty(temp)){ | |
| 512 | + | |
| 513 | + StringBuilder sb = new StringBuilder(); | |
| 514 | + | |
| 515 | + for (String sId : temp){ | |
| 516 | + sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(","); | |
| 517 | + } | |
| 518 | + if (sb.toString().endsWith(",")) { | |
| 519 | + diagnosis = sb.substring(0, sb.length() - 1); | |
| 520 | + }else { | |
| 521 | + diagnosis = sb.toString(); | |
| 522 | + } | |
| 523 | + } | |
| 524 | + } | |
| 525 | + map.put("diagnosis",diagnosis); | |
| 526 | + map.put("treatmentOpinion",data.getTreatmentOpinion()); | |
| 527 | + map.put("guide",data.getGuide()); | |
| 528 | + | |
| 529 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 530 | + br.setErrormsg("成功"); | |
| 531 | + br.setData(map); | |
| 532 | + return br; | |
| 533 | + } | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + public BaseObjectResponse findMatDeliverData(String id){ | |
| 539 | + | |
| 540 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 541 | + | |
| 542 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 543 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 544 | + br.setErrormsg("id为空"); | |
| 545 | + return br; | |
| 546 | + } | |
| 547 | + | |
| 548 | + MaternalDeliverModel data = matDeliverService.getOneMatDeliver(id); | |
| 549 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 550 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 551 | + br.setErrormsg("没有查询到数据"); | |
| 552 | + return br; | |
| 553 | + } | |
| 554 | + | |
| 555 | + /* 基本信息 */ | |
| 556 | + if (StringUtils.isEmpty(data.getParentId())){ | |
| 557 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 558 | + br.setErrormsg("数据异常"); | |
| 559 | + return br; | |
| 560 | + } | |
| 561 | + | |
| 562 | + Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 563 | + | |
| 564 | + if (patients==null){ | |
| 565 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 566 | + br.setErrormsg("数据异常"); | |
| 567 | + return br; | |
| 568 | + } | |
| 569 | + | |
| 570 | + Map<String,Object> map= new HashMap<>(); | |
| 571 | + map.put("id",data.getId()); | |
| 572 | + map.put("username",patients.getUsername()); | |
| 573 | + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 574 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 575 | + map.put("phone",patients.getPhone()); | |
| 576 | + map.put("fmWeek",patients.getFmWeek()); | |
| 577 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 578 | + map.put("mremark",patients.getMremark()); | |
| 579 | + | |
| 580 | + String riskFactor = ""; | |
| 581 | + if (StringUtils.isNotEmpty(patients.getoRiskFactor())){ | |
| 582 | + riskFactor = patients.getoRiskFactor(); | |
| 583 | + } | |
| 584 | + | |
| 585 | + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ | |
| 586 | + if (StringUtils.isEmpty(riskFactor)){ | |
| 587 | + riskFactor = commonService.resloveFactor(patients.getRiskFactorId()); | |
| 588 | + }else { | |
| 589 | + riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId()); | |
| 590 | + } | |
| 591 | + } | |
| 592 | + map.put("oRiskFactor",riskFactor); | |
| 593 | + | |
| 594 | + String riskLevel = ""; | |
| 595 | + | |
| 596 | + if (StringUtils.isNotEmpty(patients.getRiskLevelId())){ | |
| 597 | + List<String> riskLevels = JsonUtil.toList(patients.getRiskLevelId(), String.class); | |
| 598 | + if (CollectionUtils.isNotEmpty(riskLevels)){ | |
| 599 | + StringBuilder sb = new StringBuilder(); | |
| 600 | + for (String r : riskLevels){ | |
| 601 | + sb.append(FunvCommonUtil.getBaseicConfigByid(r, basicConfigService)).append(","); | |
| 602 | + } | |
| 603 | + | |
| 604 | + if (sb.toString().endsWith(",")){ | |
| 605 | + riskLevel = sb.substring(0, sb.length() - 1); | |
| 606 | + }else { | |
| 607 | + riskLevel = sb.toString(); | |
| 608 | + } | |
| 609 | + | |
| 610 | + } | |
| 611 | + } | |
| 612 | + map.put("riskLevel", riskLevel); | |
| 613 | + map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(), UnitConstants.FEN)); | |
| 614 | + | |
| 615 | + map.put("deliveryDate", data.getDueDate()); | |
| 616 | + map.put("dueWeek", data.getDueWeek()); | |
| 617 | + | |
| 618 | + String fmHospital = ""; | |
| 619 | + | |
| 620 | + if (StringUtils.isNotEmpty(data.getFmHospital())){ | |
| 621 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); | |
| 622 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 623 | + fmHospital = organization.getName(); | |
| 624 | + } | |
| 625 | + } | |
| 626 | + | |
| 627 | + map.put("fmHospital", fmHospital); | |
| 628 | + | |
| 629 | + String deliverDoctor = ""; | |
| 630 | + | |
| 631 | + if (StringUtils.isNotEmpty(data.getDeliverDoctor())){ | |
| 632 | + Users users = usersService.getUsers(Integer.parseInt(data.getDeliverDoctor())); | |
| 633 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 634 | + deliverDoctor = users.getName(); | |
| 635 | + } | |
| 636 | + } | |
| 637 | + | |
| 638 | + map.put("deliverDoctor", deliverDoctor); | |
| 639 | + | |
| 640 | + /* 分娩信息 */ | |
| 641 | + map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber() + ""));//胎数 | |
| 642 | + map.put("placenta", UnitUtils.unitSplice(data.getPlacenta(),UnitConstants.GE));//胎盘 | |
| 643 | + | |
| 644 | + List<Map<String,Object>> placetaList = new ArrayList<>(); | |
| 645 | + | |
| 646 | + if (CollectionUtils.isNotEmpty(data.getPlacentas())){ | |
| 647 | + @SuppressWarnings("unchecked") | |
| 648 | + List<MatDeliverAddRequest.Placenta> placentas = data.getPlacentas(); | |
| 649 | + if (CollectionUtils.isNotEmpty(placentas)){ | |
| 650 | + for (Object obj : placentas) { | |
| 651 | + | |
| 652 | + String fetalPosition = ""; | |
| 653 | + String fetalPresentation = ""; | |
| 654 | + String heartRate = ""; | |
| 655 | + | |
| 656 | + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { | |
| 657 | + //转换类型 | |
| 658 | + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; | |
| 659 | + //胎方位 | |
| 660 | + if (StringUtils.isNotEmpty(placenta.getFetalPosition())) { | |
| 661 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 662 | + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { | |
| 663 | + fetalPosition += fetalPositionEnums.getName(); | |
| 664 | + break; | |
| 665 | + } | |
| 666 | + } | |
| 667 | + } | |
| 668 | + //胎先露 | |
| 669 | + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation(); | |
| 670 | + //胎心率 | |
| 671 | + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString(); | |
| 672 | + | |
| 673 | + } | |
| 674 | + | |
| 675 | + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { | |
| 676 | + Map<String, String> placenta = JsonUtil.getMap(obj.toString()); | |
| 677 | + if (MapUtils.isNotEmpty(placenta)) { | |
| 678 | + if (placenta.get("fetalPosition") != null) { | |
| 679 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 680 | + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { | |
| 681 | + fetalPosition += fetalPositionEnums.getName(); | |
| 682 | + break; | |
| 683 | + } | |
| 684 | + } | |
| 685 | + } | |
| 686 | + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate"); | |
| 687 | + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation"); | |
| 688 | + } | |
| 689 | + } | |
| 690 | + Map<String,Object> placetaMap = new HashMap<>(); | |
| 691 | + placetaMap.put("fetalPosition",fetalPosition); | |
| 692 | + placetaMap.put("fetalPresentation",fetalPresentation); | |
| 693 | + placetaMap.put("heartRate",UnitUtils.unitSplice(heartRate,UnitConstants.CIFEN)); | |
| 694 | + placetaList.add(placetaMap); | |
| 695 | + } | |
| 696 | + } | |
| 697 | + } | |
| 698 | + | |
| 699 | + map.put("placentaData", placetaList);//胎盘信息 | |
| 700 | + | |
| 701 | + String deliveryMode = ""; | |
| 702 | + if (StringUtils.isNotEmpty(data.getDeliveryMode())){ | |
| 703 | + | |
| 704 | + StringBuilder sb = new StringBuilder(); | |
| 705 | + | |
| 706 | + Map m = JsonUtil.str2Obj(data.getDeliveryMode(),Map.class); | |
| 707 | + String fmfs = null; | |
| 708 | + if (m!=null){ | |
| 709 | + Object b = m.get("fmfs"); | |
| 710 | + if (b!=null){ | |
| 711 | + fmfs = b.toString(); | |
| 712 | + if (fmfs!=null){ | |
| 713 | + if (fmfs.equals("1")){ | |
| 714 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 715 | + sb.append(fmName).append(","); | |
| 716 | + String scfs = m.get("scfs").toString(); | |
| 717 | + sb.append(FmTypeEnums.getFmScNameById(scfs)); | |
| 718 | + deliveryMode = sb.toString(); | |
| 719 | + }else if (fmfs.equals("2")){ | |
| 720 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 721 | + deliveryMode = fmName; | |
| 722 | + } | |
| 723 | + } | |
| 724 | + } | |
| 725 | + } | |
| 726 | + } | |
| 727 | + map.put("deliveryMode", deliveryMode);//分娩方式 | |
| 728 | + map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause()); | |
| 729 | + | |
| 730 | + findProcess(data.getProdprocess(), map);//1,2,3产程 | |
| 731 | + findTotalProcess(data.getTotalprocess(),map);//总产程 | |
| 732 | + | |
| 733 | + map.put("perinealCondition", FunvCommonUtil.checkHuiYin(data.getPerinealCondition())); | |
| 734 | + | |
| 735 | + map.put("siLielevel", FunvCommonUtil.checkSiLieLevel(data.getSiLielevel())); | |
| 736 | + | |
| 737 | + map.put("needleNum", UnitUtils.unitSplice(data.getNeedleNum(),UnitConstants.ZHEN)); | |
| 738 | + | |
| 739 | + /* 产后生理 */ | |
| 740 | + map.put("maternalInfo", data.getMaternalInfo()); | |
| 741 | + map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause()); | |
| 742 | + // 产后血压 收缩压,舒张压 | |
| 743 | + String ssy = ""; | |
| 744 | + String szy = ""; | |
| 745 | + Map<String, String> chBpMap = JsonUtil.getMap(data.getChBp()); | |
| 746 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
| 747 | + ssy = chBpMap.get("ssy"); | |
| 748 | + szy = chBpMap.get("szy"); | |
| 749 | + } | |
| 750 | + map.put("ssy", UnitUtils.unitSplice(ssy,UnitConstants.MMHG)); | |
| 751 | + map.put("szy", UnitUtils.unitSplice(szy,UnitConstants.MMHG)); | |
| 752 | + // 产后2小时血压 收缩压,舒张压 | |
| 753 | + String ssy2h = ""; | |
| 754 | + String szy2h = ""; | |
| 755 | + Map<String, String> ch2BpMap = JsonUtil.getMap(data.getCh2Bp()); | |
| 756 | + if (MapUtils.isNotEmpty(ch2BpMap)) { | |
| 757 | + ssy2h = ch2BpMap.get("ssy"); | |
| 758 | + szy2h = ch2BpMap.get("szy"); | |
| 759 | + } | |
| 760 | + map.put("ssy2h",UnitUtils.unitSplice(ssy2h,UnitConstants.MMHG)); | |
| 761 | + map.put("szy2h", UnitUtils.unitSplice(szy2h,UnitConstants.MMHG)); | |
| 762 | + | |
| 763 | + map.put("breath", UnitUtils.unitSplice(data.getBreath(),UnitConstants.CIFEN)); | |
| 764 | + map.put("pulse", UnitUtils.unitSplice(data.getPulse(), UnitConstants.CIFEN)); | |
| 765 | + | |
| 766 | + map.put("oHloseBloodL", UnitUtils.unitSplice(data.getoHloseBloodL(),UnitConstants.ML)); | |
| 767 | + map.put("tHloseBloodL", UnitUtils.unitSplice(data.gettHloseBloodL(),UnitConstants.ML)); | |
| 768 | + map.put("rHloseBloodL", UnitUtils.unitSplice(data.getrHloseBloodL(),UnitConstants.ML)); | |
| 769 | + map.put("sHloseBloodL", UnitUtils.unitSplice(data.getsHloseBloodL(),UnitConstants.ML)); | |
| 770 | + | |
| 771 | + String loseBloodCause = ""; | |
| 772 | + if (StringUtils.isNotEmpty(data.getLoseBloodCause())){ | |
| 773 | + String loseBloodCauseJson = data.getLoseBloodCause(); | |
| 774 | + Map<String, String> loseBloodCauseMap = JsonUtil.getMap(loseBloodCauseJson); | |
| 775 | + if (MapUtils.isNotEmpty(loseBloodCauseMap) && StringUtils.isNotEmpty(loseBloodCauseMap.get("select"))) { | |
| 776 | + for (SXCauseEnums sxCauseEnums : SXCauseEnums.values()) { | |
| 777 | + if (sxCauseEnums.getId().equals(loseBloodCauseMap.get("select"))) { | |
| 778 | + loseBloodCause = sxCauseEnums.getName(); | |
| 779 | + } | |
| 780 | + } | |
| 781 | + if (SXCauseEnums.O5.getName().equals(data.getLoseBloodCause()) && StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) { | |
| 782 | + loseBloodCause = loseBloodCauseMap.get("other"); | |
| 783 | + } | |
| 784 | + } | |
| 785 | + } | |
| 786 | + map.put("loseBloodCause", loseBloodCause); | |
| 787 | + | |
| 788 | + //产科并发症(需要解析) | |
| 789 | + map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(),Map.class))); | |
| 790 | + | |
| 791 | + /* 胎盘及新生儿信息 */ | |
| 792 | + | |
| 793 | + //胎盘信息 | |
| 794 | + List<Map<String,Object>> ExtPlacentaList = new ArrayList<>(); | |
| 795 | + | |
| 796 | + if (CollectionUtils.isNotEmpty(data.getExtPlacentas())){ | |
| 797 | + for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){ | |
| 798 | + Map<String,Object> extMap = new HashMap<>(); | |
| 799 | + extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType())); | |
| 800 | + extMap.put("mcType", FunvCommonUtil.checkMianChuFS(temp.getMcType())); | |
| 801 | + String tpSize = ""; | |
| 802 | + tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + UnitConstants.CM; | |
| 803 | + extMap.put("tpSize",tpSize); | |
| 804 | + extMap.put("tpWeight",UnitUtils.unitSplice(temp.getTpWeight(),UnitConstants.G)); | |
| 805 | + extMap.put("umbilicalCordLength",UnitUtils.unitSplice(temp.getUmbilicalCordLength(),UnitConstants.CM)); | |
| 806 | + | |
| 807 | + String umbilicalCordEx = ""; | |
| 808 | + String umbilicalCordExType = ""; | |
| 809 | + | |
| 810 | + if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())){ | |
| 811 | + if (temp.getUmbilicalCordEx().equals("no")){ | |
| 812 | + umbilicalCordEx = "无"; | |
| 813 | + }else if (temp.getUmbilicalCordEx().equals("yes")){ | |
| 814 | + umbilicalCordEx = "有"; | |
| 815 | + if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())){ | |
| 816 | + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()){ | |
| 817 | + if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())){ | |
| 818 | + umbilicalCordExType = qiDaiEnums.getName(); | |
| 819 | + } | |
| 820 | + } | |
| 821 | + } | |
| 822 | + } | |
| 823 | + } | |
| 824 | + extMap.put("umbilicalCordEx",umbilicalCordEx); | |
| 825 | + extMap.put("umbilicalCordExType",umbilicalCordExType); | |
| 826 | + | |
| 827 | + ExtPlacentaList.add(extMap); | |
| 828 | + } | |
| 829 | + } | |
| 830 | + map.put("extPlacentas", ExtPlacentaList); | |
| 831 | + | |
| 832 | + //新生儿信息 | |
| 833 | + | |
| 834 | + List<Map<String,Object>> babyList = new ArrayList<>(); | |
| 835 | + | |
| 836 | + if (CollectionUtils.isNotEmpty(data.getBaby())){ | |
| 837 | + for (MaternalDeliverModel.Baby temp : data.getBaby()){ | |
| 838 | + Map<String,Object> babyMap = new HashMap<>(); | |
| 839 | + babyMap.put("dueTime",temp.getDueTime()); | |
| 840 | + babyMap.put("pregnancyOut",temp.getPregnancyOut()); | |
| 841 | + babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); | |
| 842 | + babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( | |
| 843 | + Integer.parseInt(temp.getBabyGender()))); | |
| 844 | + babyMap.put("babyWeight", UnitUtils.unitSplice(temp.getBabyWeight(),UnitConstants.G)); | |
| 845 | + babyMap.put("babyHeight", UnitUtils.unitSplice(temp.getBabyHeight(),UnitConstants.CM)); | |
| 846 | + babyMap.put("babyHealthy",temp.getBabyHealthy()); | |
| 847 | + String apgarScorePf1 = ""; | |
| 848 | + String apgarScorePf5 = ""; | |
| 849 | + String apgarScorePf10 = ""; | |
| 850 | + Map<String, String> m = JsonUtil.getMap(temp.getApgarScore()); | |
| 851 | + if (MapUtils.isNotEmpty(map)) { | |
| 852 | + apgarScorePf1 += m.get("pf1") == null ? "" : (m.get("pf1") + "*"); | |
| 853 | + apgarScorePf5 += m.get("pf5") == null ? "" : (m.get("pf5") + "*"); | |
| 854 | + apgarScorePf10 += m.get("pf10") == null ? "" : m.get("pf10"); | |
| 855 | + } | |
| 856 | + babyMap.put("apgarScore", UnitUtils.unitSplice(apgarScorePf1 + apgarScorePf5 + apgarScorePf10,UnitConstants.FEN)); | |
| 857 | + babyMap.put("asphyxiaM",UnitUtils.unitSplice(temp.getAsphyxiaM(),UnitConstants.FZ)); | |
| 858 | + babyMap.put("contactStartM",UnitUtils.unitSplice(temp.getContactStartM(),UnitConstants.FZ)); | |
| 859 | + babyMap.put("contactM",UnitUtils.unitSplice(temp.getContactM(),UnitConstants.FZ)); | |
| 860 | + babyMap.put("earlySuck",temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); | |
| 861 | + | |
| 862 | + babyList.add(babyMap); | |
| 863 | + } | |
| 864 | + } | |
| 865 | + | |
| 866 | + map.put("baby", babyList); | |
| 867 | + | |
| 868 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 869 | + br.setErrormsg("成功"); | |
| 870 | + br.setData(map); | |
| 871 | + return br; | |
| 872 | + } | |
| 873 | + | |
| 874 | + //总产程 | |
| 875 | + public static Map<String,Object> findTotalProcess(String totalProcess,Map<String,Object> map){ | |
| 876 | + | |
| 877 | + String p = ""; | |
| 878 | + | |
| 879 | + Map<String, String> totalprocessMap = JsonUtil.getMap(totalProcess); | |
| 880 | + if (MapUtils.isNotEmpty(totalprocessMap)) { | |
| 881 | + p = totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"; | |
| 882 | + } | |
| 883 | + map.put("totalProcess",p); | |
| 884 | + return map; | |
| 885 | + | |
| 886 | + } | |
| 887 | + | |
| 888 | + //解析1,2,3产程 | |
| 889 | + public static Map<String,Object> findProcess(String process,Map<String,Object> map){ | |
| 890 | +// process = "{\"one\":{\"h\":4,\"m\":20},\"two\":{\"m\":53},\"three\":{\"m\":7}}"; | |
| 891 | + String one = ""; | |
| 892 | + String two = ""; | |
| 893 | + String three = ""; | |
| 894 | + Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(process); | |
| 895 | + if (MapUtils.isNotEmpty(prodprocessMap)) { | |
| 896 | + Map<String, String> prodprocessOne = prodprocessMap.get("one"); | |
| 897 | + if (MapUtils.isNotEmpty(prodprocessOne)) { | |
| 898 | + one = prodprocessOne.get("h") + "时" + prodprocessOne.get("m") + "分"; | |
| 899 | + } | |
| 900 | + Map<String, String> prodprocessTwo = prodprocessMap.get("two"); | |
| 901 | + if (MapUtils.isNotEmpty(prodprocessTwo)) { | |
| 902 | + two = prodprocessOne.get("h") + "时" + prodprocessTwo.get("m") + "分"; | |
| 903 | + } | |
| 904 | + Map<String, String> prodprocessThree = prodprocessMap.get("three"); | |
| 905 | + if (MapUtils.isNotEmpty(prodprocessThree)) { | |
| 906 | + three = prodprocessOne.get("h") + "时" + prodprocessThree.get("m") + "分"; | |
| 907 | + } | |
| 908 | + } | |
| 909 | + map.put("one",one); | |
| 910 | + map.put("two",two); | |
| 911 | + map.put("three",three); | |
| 912 | + return map; | |
| 913 | + } | |
| 914 | + | |
| 915 | + | |
| 916 | +} |