Commit 3ab3df73e3cec2f209c9c2553dbc39480fc330e9
1 parent
6f623672c7
Exists in
master
and in
2 other branches
提交查看初诊复诊接口代码
Showing 5 changed files with 666 additions and 103 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.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/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/UnitConstants.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
3ab3df7
| ... | ... | @@ -18,8 +18,6 @@ |
| 18 | 18 | import com.lyms.platform.operate.web.utils.FunvCommonUtil; |
| 19 | 19 | import com.lyms.platform.operate.web.utils.UnitConstants; |
| 20 | 20 | import com.lyms.platform.operate.web.utils.UnitUtils; |
| 21 | -import com.lyms.platform.operate.web.worker.AntExRecordWorker; | |
| 22 | -import com.lyms.platform.operate.web.worker.WorkHR; | |
| 23 | 21 | import com.lyms.platform.permission.model.Organization; |
| 24 | 22 | import com.lyms.platform.permission.model.OrganizationQuery; |
| 25 | 23 | import com.lyms.platform.permission.model.Users; |
| 26 | 24 | |
| ... | ... | @@ -31,16 +29,12 @@ |
| 31 | 29 | import org.apache.commons.collections.MapUtils; |
| 32 | 30 | import org.apache.commons.lang.math.NumberUtils; |
| 33 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
| 34 | -import org.springframework.beans.factory.annotation.Qualifier; | |
| 35 | -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |
| 36 | 32 | import org.springframework.stereotype.Component; |
| 37 | 33 | |
| 38 | 34 | import javax.servlet.http.HttpServletResponse; |
| 39 | 35 | import java.io.IOException; |
| 40 | 36 | import java.io.OutputStream; |
| 41 | 37 | import java.util.*; |
| 42 | -import java.util.concurrent.Future; | |
| 43 | -import java.util.concurrent.TimeUnit; | |
| 44 | 38 | |
| 45 | 39 | /** |
| 46 | 40 | * 产检管理 |
| ... | ... | @@ -67,9 +61,6 @@ |
| 67 | 61 | private OrganizationService organizationService; |
| 68 | 62 | @Autowired |
| 69 | 63 | private DataPermissionService dataPermissionService; |
| 70 | - @Autowired | |
| 71 | - @Qualifier("commonThreadPool") | |
| 72 | - private ThreadPoolTaskExecutor commonThreadPool; | |
| 73 | 64 | |
| 74 | 65 | public void syncAntRecordToList(String hospitalId) { |
| 75 | 66 | recordService.syncAntRecordToList(hospitalId); |
| 76 | 67 | |
| 77 | 68 | |
| ... | ... | @@ -223,22 +214,65 @@ |
| 223 | 214 | List<AntExManagerResult> data = new ArrayList<>(); |
| 224 | 215 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); |
| 225 | 216 | if (CollectionUtils.isNotEmpty(antExRecordModelList)) { |
| 226 | - int batchSize = 4; | |
| 227 | - int end = 0; | |
| 228 | - List<Future> listFuture = new ArrayList<>(); | |
| 229 | - for (int i = 0; i < antExRecordModelList.size(); i += batchSize) { | |
| 230 | - end = (end + batchSize); | |
| 231 | - if (end > antExRecordModelList.size()) { | |
| 232 | - end = antExRecordModelList.size(); | |
| 217 | + for (AntExRecordModel e : antExRecordModelList) { | |
| 218 | + AntExManagerResult antExManagerResult = new AntExManagerResult(); | |
| 219 | + antExManagerResult.convertToResult(e); | |
| 220 | + if (isRegion) { | |
| 221 | + //产检医院 | |
| 222 | + if (StringUtils.isNotEmpty(e.getHospitalId())) { | |
| 223 | + Organization org = organizationService.getOrganization(Integer.valueOf(e.getHospitalId())); | |
| 224 | + if (null != org) { | |
| 225 | + antExManagerResult.setCheckHospital(org.getName()); | |
| 226 | + } else { | |
| 227 | + antExManagerResult.setCheckHospital(e.getHospitalId()); | |
| 228 | + } | |
| 229 | + } | |
| 230 | + antExManagerResult.setAddr(CommonsHelper.getResidence(e.getProvinceRegisterId(), e.getCityRegisterId(), e.getAreaRegisterId(), e.getStreetRegisterId(), e.getAddressRegister(), basicConfigService)); | |
| 233 | 231 | } |
| 234 | - listFuture.add(commonThreadPool.submit(new AntExRecordWorker(antExRecordModelList.subList(i, end), isRegion, organizationService, usersService, recordService, commonService, hospital, basicConfigService))); | |
| 235 | - } | |
| 236 | - for (Future f : listFuture) { | |
| 237 | - try { | |
| 238 | - data.addAll((List) f.get(30, TimeUnit.SECONDS)); | |
| 239 | - } catch (Exception e) { | |
| 240 | - ExceptionUtils.catchException(e, "antexrecord findList get result future error."); | |
| 232 | + | |
| 233 | + //登记人 | |
| 234 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getBuildDoctor())) { | |
| 235 | + if (NumberUtils.isNumber(e.getBuildDoctor())) { | |
| 236 | + Users users = usersService.getUsers(NumberUtils.toInt(e.getBuildDoctor())); | |
| 237 | + if (null != users) { | |
| 238 | + antExManagerResult.setlName(users.getName()); | |
| 239 | + } else { | |
| 240 | + antExManagerResult.setlName(e.getBuildDoctor()); | |
| 241 | + } | |
| 242 | + } else { | |
| 243 | + antExManagerResult.setlName(e.getBuildDoctor()); | |
| 244 | + } | |
| 241 | 245 | } |
| 246 | + //产检医生 | |
| 247 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getCheckDoctor())) { | |
| 248 | + if (NumberUtils.isNumber(e.getCheckDoctor())) { | |
| 249 | + Users users = usersService.getUsers(NumberUtils.toInt(e.getCheckDoctor())); | |
| 250 | + if (null != users) { | |
| 251 | + antExManagerResult.setCheckDoctor(users.getName()); | |
| 252 | + } else { | |
| 253 | + antExManagerResult.setCheckDoctor(e.getCheckDoctor()); | |
| 254 | + } | |
| 255 | + } else { | |
| 256 | + antExManagerResult.setCheckDoctor(e.getCheckDoctor()); | |
| 257 | + } | |
| 258 | + } | |
| 259 | + | |
| 260 | + AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery(); | |
| 261 | + antExRecordQuery1.setCheckTimeEnd(e.getCheckTime()); | |
| 262 | + antExRecordQuery1.setPid(e.getPid()); | |
| 263 | + antExRecordQuery1.setHospitalId(hospital); | |
| 264 | + | |
| 265 | + //本院低次 | |
| 266 | + int dichi = recordService.count(antExRecordQuery1); | |
| 267 | + antExRecordQuery1.setHospitalId(null); | |
| 268 | + | |
| 269 | + antExManagerResult.settTimes(recordService.count(antExRecordQuery1)); | |
| 270 | + antExManagerResult.setChTimes(dichi); | |
| 271 | + //高危因素 | |
| 272 | + antExManagerResult.setrLevel(commonService.findRiskLevel(e.gethLevel())); | |
| 273 | + antExManagerResult.setRiskFactor(commonService.resloveFactor(e.gethRisk())); | |
| 274 | + | |
| 275 | + data.add(antExManagerResult); | |
| 242 | 276 | } |
| 243 | 277 | } |
| 244 | 278 | return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(antExRecordQuery.getPageInfo()); |
| 245 | 279 | |
| 246 | 280 | |
| 247 | 281 | |
| 248 | 282 | |
| 249 | 283 | |
| 250 | 284 | |
| 251 | 285 | |
| 252 | 286 | |
| 253 | 287 | |
| 254 | 288 | |
| ... | ... | @@ -519,62 +553,62 @@ |
| 519 | 553 | |
| 520 | 554 | |
| 521 | 555 | //查询复诊接口 |
| 522 | - public BaseObjectResponse findAntenatalExamination(String id) { | |
| 556 | + public BaseObjectResponse findAntenatalExamination(String id){ | |
| 523 | 557 | |
| 524 | 558 | BaseObjectResponse br = new BaseObjectResponse(); |
| 525 | - if (org.apache.commons.lang.StringUtils.isEmpty(id)) { | |
| 559 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 526 | 560 | br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
| 527 | 561 | br.setErrormsg("id为空"); |
| 528 | 562 | return br; |
| 529 | 563 | } |
| 530 | 564 | |
| 531 | 565 | AntenatalExaminationModel data = antExService.findOneById(id); |
| 532 | - if (data == null || data.getYn() == YnEnums.NO.getId()) { | |
| 566 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 533 | 567 | br.setErrorcode(ErrorCodeConstants.NO_DATA); |
| 534 | 568 | br.setErrormsg("没有查询到数据"); |
| 535 | 569 | return br; |
| 536 | 570 | } |
| 537 | 571 | |
| 538 | 572 | |
| 539 | - if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())) { | |
| 573 | + if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())){ | |
| 540 | 574 | br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
| 541 | 575 | br.setErrormsg("数据异常"); |
| 542 | 576 | return br; |
| 543 | 577 | } |
| 544 | 578 | |
| 545 | 579 | Patients patients = patientsService.findOnePatientById(data.getParentId()); |
| 546 | - if (patients == null || patients.getYn() == YnEnums.NO.getId()) { | |
| 580 | + if (patients==null || patients.getYn()==YnEnums.NO.getId()){ | |
| 547 | 581 | br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
| 548 | 582 | br.setErrormsg("孕妇信息不存在"); |
| 549 | 583 | return br; |
| 550 | 584 | } |
| 551 | 585 | |
| 552 | - Map<String, Object> map = new HashMap<>(); | |
| 586 | + Map<String,Object> map= new HashMap<>(); | |
| 553 | 587 | /* 基本信息 */ |
| 554 | 588 | //孕妇基本信息 |
| 555 | - map.put("id", data.getId()); | |
| 556 | - map.put("username", patients.getUsername()); | |
| 557 | - map.put("birth", DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 558 | - map.put("age", DateUtil.getAge(patients.getBirth())); | |
| 559 | - map.put("phone", patients.getPhone()); | |
| 560 | - map.put("fmWeek", patients.getFmWeek()); | |
| 561 | - map.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 562 | - map.put("mremark", patients.getMremark()); | |
| 563 | - map.put("oRiskFactor", patients.getoRiskFactor()); | |
| 564 | - map.put("riskScore", patients.getRiskScore()); | |
| 589 | + map.put("id",data.getId()); | |
| 590 | + map.put("username",patients.getUsername()); | |
| 591 | + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 592 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 593 | + map.put("phone",patients.getPhone()); | |
| 594 | + map.put("fmWeek",patients.getFmWeek()); | |
| 595 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 596 | + map.put("mremark",patients.getMremark()); | |
| 597 | + map.put("oRiskFactor",patients.getoRiskFactor()); | |
| 598 | + map.put("riskScore",patients.getRiskScore()); | |
| 565 | 599 | //产检基本信息 |
| 566 | - map.put("checkDate", DateUtil.getyyyy_MM_dd(data.getCheckDate())); | |
| 567 | - map.put("currentDueDate", data.getCurrentDueDate()); | |
| 600 | + map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate())); | |
| 601 | + map.put("currentDueDate",data.getCurrentDueDate()); | |
| 568 | 602 | map.put("checkDoctor", data.getCheckDoctor()); |
| 569 | 603 | String hospital = ""; |
| 570 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())) { | |
| 604 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 571 | 605 | Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); |
| 572 | - if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
| 606 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 573 | 607 | hospital = organization.getName(); |
| 574 | 608 | } |
| 575 | 609 | } |
| 576 | 610 | map.put("hospital", hospital); |
| 577 | - map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
| 611 | + map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
| 578 | 612 | map.put("cDueWeek", data.getcDueWeek()); |
| 579 | 613 | |
| 580 | 614 | /* 复诊信息 */ |
| 581 | 615 | |
| 582 | 616 | |
| 583 | 617 | |
| 584 | 618 | |
| 585 | 619 | |
| 586 | 620 | |
| 587 | 621 | |
| 588 | 622 | |
| 589 | 623 | |
| 590 | 624 | |
| 591 | 625 | |
| ... | ... | @@ -592,63 +626,63 @@ |
| 592 | 626 | map.put("gongGao", UnitUtils.unitSplice(data.getGongGao(), UnitConstants.CM)); |
| 593 | 627 | map.put("abdominalCircumference", UnitUtils.unitSplice(data.getAbdominalCircumference(), UnitConstants.CM)); |
| 594 | 628 | String edema = ""; |
| 595 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getEdema())) { | |
| 596 | - for (FuZhongEnums fuZhongEnums : FuZhongEnums.values()) { | |
| 597 | - if (data.getEdema().equals(fuZhongEnums.getId())) { | |
| 629 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getEdema())){ | |
| 630 | + for (FuZhongEnums fuZhongEnums:FuZhongEnums.values()){ | |
| 631 | + if (data.getEdema().equals(fuZhongEnums.getId())){ | |
| 598 | 632 | edema = fuZhongEnums.getName(); |
| 599 | 633 | } |
| 600 | 634 | } |
| 601 | 635 | } |
| 602 | - map.put("edema", edema); | |
| 636 | + map.put("edema",edema); | |
| 603 | 637 | |
| 604 | 638 | map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); |
| 605 | 639 | //胎儿情况 |
| 606 | 640 | List<Map> tireList = new ArrayList<>(); |
| 607 | - if (CollectionUtils.isNotEmpty(data.getTireData())) { | |
| 608 | - for (Object temp : data.getTireData()) { | |
| 609 | - Map<String, String> tire = JsonUtil.getMap(temp.toString()); | |
| 641 | + if (CollectionUtils.isNotEmpty(data.getTireData())){ | |
| 642 | + for (Object temp : data.getTireData()){ | |
| 643 | + Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
| 610 | 644 | String heartRate = tire.get("heartRate"); |
| 611 | 645 | String fetalPosition = tire.get("fetalPosition"); |
| 612 | 646 | String fetalPresentation = tire.get("fetalPresentation"); |
| 613 | 647 | String join = tire.get("join"); |
| 614 | 648 | |
| 615 | - Map<String, Object> tireMap = new HashMap<>(); | |
| 616 | - tireMap.put("heartRate", UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 649 | + Map<String,Object> tireMap = new HashMap<>(); | |
| 650 | + tireMap.put("heartRate",UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 617 | 651 | tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); |
| 618 | 652 | tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); |
| 619 | 653 | tireMap.put("join", JoinEnums.getTitle(join)); |
| 620 | 654 | tireList.add(tireMap); |
| 621 | 655 | } |
| 622 | 656 | } |
| 623 | - map.put("tireData", tireList); | |
| 657 | + map.put("tireData",tireList); | |
| 624 | 658 | |
| 625 | 659 | /* 辅助信息 */ |
| 626 | 660 | map.put("hemoglobin", UnitUtils.unitSplice(data.getHemoglobin(), UnitConstants.GL)); |
| 627 | - map.put("urineProtein", data.getUrineProtein()); | |
| 661 | + map.put("urineProtein",data.getUrineProtein()); | |
| 628 | 662 | map.put("bloodSugar", UnitUtils.unitSplice(data.getUrineProtein(), UnitConstants.MMOLL)); |
| 629 | - map.put("bChao", data.getbChao()); | |
| 663 | + map.put("bChao",data.getbChao()); | |
| 630 | 664 | |
| 631 | 665 | /* 诊断指导 */ |
| 632 | 666 | String diagnosis = ""; |
| 633 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())) { | |
| 667 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())){ | |
| 634 | 668 | List<String> temp = JsonUtil.toList(data.getDiagnosis(), String.class); |
| 635 | - if (CollectionUtils.isNotEmpty(temp)) { | |
| 669 | + if (CollectionUtils.isNotEmpty(temp)){ | |
| 636 | 670 | |
| 637 | 671 | StringBuilder sb = new StringBuilder(); |
| 638 | 672 | |
| 639 | - for (String sId : temp) { | |
| 673 | + for (String sId : temp){ | |
| 640 | 674 | sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(","); |
| 641 | 675 | } |
| 642 | 676 | if (sb.toString().endsWith(",")) { |
| 643 | 677 | diagnosis = sb.substring(0, sb.length() - 1); |
| 644 | - } else { | |
| 678 | + }else { | |
| 645 | 679 | diagnosis = sb.toString(); |
| 646 | 680 | } |
| 647 | 681 | } |
| 648 | 682 | } |
| 649 | - map.put("diagnosis", diagnosis); | |
| 650 | - map.put("treatmentOpinion", data.getTreatmentOpinion()); | |
| 651 | - map.put("guide", data.getGuide()); | |
| 683 | + map.put("diagnosis",diagnosis); | |
| 684 | + map.put("treatmentOpinion",data.getTreatmentOpinion()); | |
| 685 | + map.put("guide",data.getGuide()); | |
| 652 | 686 | |
| 653 | 687 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 654 | 688 | br.setErrormsg("成功"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
3ab3df7
| ... | ... | @@ -11,6 +11,10 @@ |
| 11 | 11 | import com.lyms.platform.common.utils.SystemConfig; |
| 12 | 12 | import com.lyms.platform.operate.web.request.*; |
| 13 | 13 | import com.lyms.platform.operate.web.result.*; |
| 14 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
| 15 | +import com.lyms.platform.operate.web.utils.ResolveUtils; | |
| 16 | +import com.lyms.platform.operate.web.utils.UnitConstants; | |
| 17 | +import com.lyms.platform.operate.web.utils.UnitUtils; | |
| 14 | 18 | import com.lyms.platform.permission.model.Organization; |
| 15 | 19 | import com.lyms.platform.permission.model.Users; |
| 16 | 20 | import com.lyms.platform.permission.service.OrganizationService; |
| ... | ... | @@ -18,6 +22,7 @@ |
| 18 | 22 | import com.lyms.platform.pojo.*; |
| 19 | 23 | import com.lyms.platform.query.*; |
| 20 | 24 | import org.apache.commons.collections.CollectionUtils; |
| 25 | +import org.apache.commons.collections.MapUtils; | |
| 21 | 26 | import org.apache.commons.lang.StringUtils; |
| 22 | 27 | import org.apache.commons.lang.math.NumberUtils; |
| 23 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -66,6 +71,8 @@ |
| 66 | 71 | @Autowired |
| 67 | 72 | private PatientCheckTicketService patientCheckTicketService; |
| 68 | 73 | |
| 74 | + @Autowired | |
| 75 | + private AntenatalExaminationService antExService; | |
| 69 | 76 | /** |
| 70 | 77 | * 处理区域隐藏建档 |
| 71 | 78 | * |
| ... | ... | @@ -2156,5 +2163,413 @@ |
| 2156 | 2163 | } |
| 2157 | 2164 | return list; |
| 2158 | 2165 | } |
| 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 | + | |
| 2159 | 2574 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
3ab3df7
| ... | ... | @@ -11,9 +11,7 @@ |
| 11 | 11 | import com.lyms.platform.operate.web.request.MatDeliverQueryRequest; |
| 12 | 12 | import com.lyms.platform.operate.web.request.NewBabyManagerRequest; |
| 13 | 13 | import com.lyms.platform.operate.web.result.*; |
| 14 | -import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 15 | -import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
| 16 | -import com.lyms.platform.operate.web.utils.ResolveUtils; | |
| 14 | +import com.lyms.platform.operate.web.utils.*; | |
| 17 | 15 | import com.lyms.platform.permission.model.Organization; |
| 18 | 16 | import com.lyms.platform.permission.model.OrganizationQuery; |
| 19 | 17 | import com.lyms.platform.permission.model.Users; |
| 20 | 18 | |
| ... | ... | @@ -1699,9 +1697,28 @@ |
| 1699 | 1697 | } |
| 1700 | 1698 | } |
| 1701 | 1699 | map.put("oRiskFactor",riskFactor); |
| 1702 | - map.put("riskLevel", FunvCommonUtil.getBaseicConfigByid(patients.getRiskLevelId(), basicConfigService)); | |
| 1703 | - map.put("riskScore",patients.getRiskScore()); | |
| 1704 | 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 | + | |
| 1705 | 1722 | map.put("deliveryDate", data.getDueDate()); |
| 1706 | 1723 | map.put("dueWeek", data.getDueWeek()); |
| 1707 | 1724 | |
| ... | ... | @@ -1729,7 +1746,7 @@ |
| 1729 | 1746 | |
| 1730 | 1747 | /* 分娩信息 */ |
| 1731 | 1748 | map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber() + ""));//胎数 |
| 1732 | - map.put("placenta", data.getPlacenta());//胎盘 | |
| 1749 | + map.put("placenta", UnitUtils.unitSplice(data.getPlacenta(),UnitConstants.GE));//胎盘 | |
| 1733 | 1750 | |
| 1734 | 1751 | List<Map<String,Object>> placetaList = new ArrayList<>(); |
| 1735 | 1752 | |
| ... | ... | @@ -1780,7 +1797,7 @@ |
| 1780 | 1797 | Map<String,Object> placetaMap = new HashMap<>(); |
| 1781 | 1798 | placetaMap.put("fetalPosition",fetalPosition); |
| 1782 | 1799 | placetaMap.put("fetalPresentation",fetalPresentation); |
| 1783 | - placetaMap.put("heartRate",heartRate); | |
| 1800 | + placetaMap.put("heartRate",UnitUtils.unitSplice(heartRate,UnitConstants.CIFEN)); | |
| 1784 | 1801 | placetaList.add(placetaMap); |
| 1785 | 1802 | } |
| 1786 | 1803 | } |
| 1787 | 1804 | |
| 1788 | 1805 | |
| ... | ... | @@ -1820,11 +1837,11 @@ |
| 1820 | 1837 | findProcess(data.getProdprocess(), map);//1,2,3产程 |
| 1821 | 1838 | findTotalProcess(data.getTotalprocess(),map);//总产程 |
| 1822 | 1839 | |
| 1823 | - map.put("perinealCondition", data.getPerinealCondition()); | |
| 1840 | + map.put("perinealCondition", FunvCommonUtil.checkHuiYin(data.getPerinealCondition())); | |
| 1824 | 1841 | |
| 1825 | - //TODO 撕裂等级 | |
| 1842 | + map.put("siLielevel", FunvCommonUtil.checkSiLieLevel(data.getSiLielevel())); | |
| 1826 | 1843 | |
| 1827 | - map.put("needleNum", data.getNeedleNum()); | |
| 1844 | + map.put("needleNum", UnitUtils.unitSplice(data.getNeedleNum(),UnitConstants.ZHEN)); | |
| 1828 | 1845 | |
| 1829 | 1846 | /* 产后生理 */ |
| 1830 | 1847 | map.put("maternalInfo", data.getMaternalInfo()); |
| ... | ... | @@ -1837,8 +1854,8 @@ |
| 1837 | 1854 | ssy = chBpMap.get("ssy"); |
| 1838 | 1855 | szy = chBpMap.get("szy"); |
| 1839 | 1856 | } |
| 1840 | - map.put("ssy", ssy); | |
| 1841 | - map.put("szy", szy); | |
| 1857 | + map.put("ssy", UnitUtils.unitSplice(ssy,UnitConstants.MMHG)); | |
| 1858 | + map.put("szy", UnitUtils.unitSplice(szy,UnitConstants.MMHG)); | |
| 1842 | 1859 | // 产后2小时血压 收缩压,舒张压 |
| 1843 | 1860 | String ssy2h = ""; |
| 1844 | 1861 | String szy2h = ""; |
| 1845 | 1862 | |
| 1846 | 1863 | |
| ... | ... | @@ -1847,17 +1864,34 @@ |
| 1847 | 1864 | ssy2h = ch2BpMap.get("ssy"); |
| 1848 | 1865 | szy2h = ch2BpMap.get("szy"); |
| 1849 | 1866 | } |
| 1850 | - map.put("ssy2h", ssy2h); | |
| 1851 | - map.put("szy2h", szy2h); | |
| 1867 | + map.put("ssy2h",UnitUtils.unitSplice(ssy2h,UnitConstants.MMHG)); | |
| 1868 | + map.put("szy2h", UnitUtils.unitSplice(szy2h,UnitConstants.MMHG)); | |
| 1852 | 1869 | |
| 1853 | - map.put("breath", data.getBreath()); | |
| 1854 | - map.put("pulse", data.getPulse()); | |
| 1870 | + map.put("breath", UnitUtils.unitSplice(data.getBreath(),UnitConstants.CIFEN)); | |
| 1871 | + map.put("pulse", UnitUtils.unitSplice(data.getPulse(), UnitConstants.CIFEN)); | |
| 1855 | 1872 | |
| 1856 | - map.put("oHloseBloodL", data.getoHloseBloodL()); | |
| 1857 | - map.put("tHloseBloodL", data.gettHloseBloodL()); | |
| 1858 | - map.put("rHloseBloodL", data.getrHloseBloodL()); | |
| 1859 | - map.put("sHloseBloodL", data.getsHloseBloodL()); | |
| 1860 | - map.put("loseBloodCause", data.getLoseBloodCause()); | |
| 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 | + | |
| 1861 | 1895 | //产科并发症(需要解析) |
| 1862 | 1896 | map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(),Map.class))); |
| 1863 | 1897 | |
| 1864 | 1898 | |
| 1865 | 1899 | |
| ... | ... | @@ -1870,12 +1904,12 @@ |
| 1870 | 1904 | for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){ |
| 1871 | 1905 | Map<String,Object> extMap = new HashMap<>(); |
| 1872 | 1906 | extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType())); |
| 1873 | - //TODO 娩出方式??? | |
| 1907 | + extMap.put("mcType", FunvCommonUtil.checkMianChuFS(temp.getMcType())); | |
| 1874 | 1908 | String tpSize = ""; |
| 1875 | - tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + "cm"; | |
| 1909 | + tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + UnitConstants.CM; | |
| 1876 | 1910 | extMap.put("tpSize",tpSize); |
| 1877 | - extMap.put("tpWeight",temp.getTpWeight()); | |
| 1878 | - extMap.put("umbilicalCordLength",temp.getUmbilicalCordLength()); | |
| 1911 | + extMap.put("tpWeight",UnitUtils.unitSplice(temp.getTpWeight(),UnitConstants.G)); | |
| 1912 | + extMap.put("umbilicalCordLength",UnitUtils.unitSplice(temp.getUmbilicalCordLength(),UnitConstants.CM)); | |
| 1879 | 1913 | |
| 1880 | 1914 | String umbilicalCordEx = ""; |
| 1881 | 1915 | String umbilicalCordExType = ""; |
| 1882 | 1916 | |
| 1883 | 1917 | |
| ... | ... | @@ -1914,22 +1948,22 @@ |
| 1914 | 1948 | babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); |
| 1915 | 1949 | babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( |
| 1916 | 1950 | Integer.parseInt(temp.getBabyGender()))); |
| 1917 | - babyMap.put("babyWeight",temp.getBabyWeight()); | |
| 1918 | - babyMap.put("babyHeight",temp.getBabyHeight()); | |
| 1951 | + babyMap.put("babyWeight", UnitUtils.unitSplice(temp.getBabyWeight(),UnitConstants.G)); | |
| 1952 | + babyMap.put("babyHeight", UnitUtils.unitSplice(temp.getBabyHeight(),UnitConstants.CM)); | |
| 1919 | 1953 | babyMap.put("babyHealthy",temp.getBabyHealthy()); |
| 1920 | 1954 | String apgarScorePf1 = ""; |
| 1921 | 1955 | String apgarScorePf5 = ""; |
| 1922 | 1956 | String apgarScorePf10 = ""; |
| 1923 | 1957 | Map<String, String> m = JsonUtil.getMap(temp.getApgarScore()); |
| 1924 | 1958 | if (MapUtils.isNotEmpty(map)) { |
| 1925 | - apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + "*"; | |
| 1926 | - apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + "*"; | |
| 1927 | - apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10"); | |
| 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"); | |
| 1928 | 1962 | } |
| 1929 | - babyMap.put("apgarScore",apgarScorePf1 + apgarScorePf5 + apgarScorePf10); | |
| 1930 | - babyMap.put("asphyxiaM",temp.getAsphyxiaM()); | |
| 1931 | - babyMap.put("contactStartM",temp.getContactStartM()); | |
| 1932 | - babyMap.put("contactM",temp.getContactM()); | |
| 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)); | |
| 1933 | 1967 | babyMap.put("earlySuck",temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); |
| 1934 | 1968 | |
| 1935 | 1969 | babyList.add(babyMap); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
View file @
3ab3df7
| ... | ... | @@ -29,6 +29,8 @@ |
| 29 | 29 | content.put("zxmxgxybfzxqq", "子痫慢性高血压并发子痫前期"); |
| 30 | 30 | content.put("rshbmxgxy", "妊娠合并慢性高血压"); |
| 31 | 31 | content.put("qt", "其他"); |
| 32 | + content.put("jsjmj", "假丝酵母菌"); | |
| 33 | + content.put("dc", "滴虫"); | |
| 32 | 34 | } |
| 33 | 35 | |
| 34 | 36 | /** |
| 35 | 37 | |
| 36 | 38 | |
| 37 | 39 | |
| ... | ... | @@ -82,14 +84,82 @@ |
| 82 | 84 | return ""; |
| 83 | 85 | } |
| 84 | 86 | |
| 87 | + //解析阴道分泌物字段 | |
| 88 | + public static String replaceYDFMW(Map map,Integer type) { | |
| 89 | + if (map==null){ | |
| 90 | + return null; | |
| 91 | + } | |
| 92 | + | |
| 93 | + String ydfmw = ""; | |
| 94 | + String ydqjd = ""; | |
| 95 | + | |
| 96 | + StringBuilder sb = new StringBuilder(); | |
| 97 | + try { | |
| 98 | + if (map.get("ydqjd")!=null){ | |
| 99 | + ydqjd = (String)map.get("ydqjd"); | |
| 100 | + } | |
| 101 | + | |
| 102 | + if ("yes".equals(map.get("yesOrNO"))) { | |
| 103 | + Set<Map.Entry<String, Object>> m = map.entrySet(); | |
| 104 | + Iterator<Map.Entry<String, Object>> it = m.iterator(); | |
| 105 | + while (it.hasNext()) { | |
| 106 | + Map.Entry<String, Object> ma = it.next(); | |
| 107 | + if (ma.getKey().equals("yesOrNO")) { | |
| 108 | + continue; | |
| 109 | + } | |
| 110 | + if ("true".equals(ma.getValue() + "")) { | |
| 111 | + | |
| 112 | + if (content.containsKey(ma.getKey())) { | |
| 113 | + sb.append(content.get(ma.getKey())).append(','); | |
| 114 | + } | |
| 115 | + } | |
| 116 | + } | |
| 117 | + | |
| 118 | + String bigSB = sb.toString(); | |
| 119 | + | |
| 120 | + if (bigSB.contains("其他,")) { | |
| 121 | + if (map.containsKey("qtText")) { | |
| 122 | + bigSB = bigSB.replace("其他,", "其他:" + map.get("qtText")); | |
| 123 | + } | |
| 124 | + } | |
| 125 | + | |
| 126 | + if (bigSB.endsWith(",")) { | |
| 127 | + bigSB = bigSB.substring(0, bigSB.length() - 1); | |
| 128 | + } | |
| 129 | + | |
| 130 | + ydfmw = bigSB; | |
| 131 | + | |
| 132 | + } else if ("no".equals(map.get("yesOrNO"))) { | |
| 133 | + ydfmw = "未见异常"; | |
| 134 | + } | |
| 135 | + | |
| 136 | + if (type==1){ | |
| 137 | + return ydfmw; | |
| 138 | + }else if (type==2){ | |
| 139 | + return ydqjd; | |
| 140 | + } | |
| 141 | + }catch (Exception e){ | |
| 142 | + e.printStackTrace(); | |
| 143 | + } | |
| 144 | + return ""; | |
| 145 | + } | |
| 146 | + | |
| 147 | + | |
| 85 | 148 | public static void main(String[] str) { |
| 86 | - String ssss = "{\"qztp\":true,\"yesOrNo\":\"no\",\"tpzb\":true,\"zxqqz\":true,\"zxqqq\":true,\"tpzl\":true," + | |
| 87 | - "\"zxmxgxybfzxqq\":true,\"chcx\":true,\"rshbmxgxy\":true,\"tmzp\":true,\"rsqgxy\":true,\"qt\":false,\"qtText\":\"11\"}"; | |
| 149 | +// String ssss = "{\"qztp\":true,\"yesOrNo\":\"no\",\"tpzb\":true,\"zxqqz\":true,\"zxqqq\":true,\"tpzl\":true," + | |
| 150 | +// "\"zxmxgxybfzxqq\":true,\"chcx\":true,\"rshbmxgxy\":true,\"tmzp\":true,\"rsqgxy\":true,\"qt\":false,\"qtText\":\"11\"}"; | |
| 151 | +// | |
| 152 | +// Map m = JsonUtil.str2Obj(ssss,Map.class); | |
| 153 | +// | |
| 154 | +// String a = replace(m); | |
| 155 | +// System.out.print("哈哈.................... " + a); | |
| 88 | 156 | |
| 89 | - Map m = JsonUtil.str2Obj(ssss,Map.class); | |
| 157 | + String s = "{\"qt\":true,\"jsjmj\":true,\"ydqjd\":\"5769ef930cf2d37f03479390\",\"qtText\":\"其他\",\"yesOrNO\":\"yes\",\"dc\":true}"; | |
| 158 | + Map m = JsonUtil.str2Obj(s,Map.class); | |
| 90 | 159 | |
| 91 | - String a = replace(m); | |
| 92 | - System.out.print("哈哈.................... " + a); | |
| 160 | + String a = replaceYDFMW(m,1); | |
| 161 | + | |
| 162 | + System.out.print("......................... "+ a); | |
| 93 | 163 | } |
| 94 | 164 | |
| 95 | 165 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/UnitConstants.java
View file @
3ab3df7
| ... | ... | @@ -14,6 +14,16 @@ |
| 14 | 14 | public static final String CIFEN = " 次/分"; |
| 15 | 15 | public static final String GL = " g/L"; |
| 16 | 16 | public static final String MMOLL = " mmol/L"; |
| 17 | + public static final String CI = " 次"; | |
| 18 | + public static final String UL = " U/L"; | |
| 19 | + public static final String TEN_LKG = " 10^9/Lkg"; | |
| 20 | + public static final String UMOLL = " umol/L"; | |
| 21 | + public static final String ZHEN = " 针"; | |
| 22 | + public static final String ML = " ml"; | |
| 23 | + public static final String G = " g"; | |
| 24 | + public static final String FEN = " 分"; | |
| 25 | + public static final String FZ = " 分钟"; | |
| 26 | + public static final String GE = " 个"; | |
| 17 | 27 | |
| 18 | 28 | |
| 19 | 29 | } |