Commit 3e913927d7d026c1763949b0f0224e711d72a4a8
1 parent
541d2fec33
Exists in
master
and in
7 other branches
update bug
Showing 8 changed files with 249 additions and 17 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/FetalEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/FetalPositionEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/JoinEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/TaiShuEnums.java
- 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/facade/AntExRecordFacade.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/UnitConstants.java
platform-common/src/main/java/com/lyms/platform/common/enums/FetalEnums.java
View file @
3e91392
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import org.apache.commons.lang.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 胎先露 |
5 | 7 | * |
... | ... | @@ -10,6 +12,18 @@ |
10 | 12 | B("臀","2"), |
11 | 13 | C("足","3"), |
12 | 14 | D("肩","4"); |
15 | + | |
16 | + public static String getTitle(String id){ | |
17 | + if (StringUtils.isNotEmpty(id)){ | |
18 | + for (FetalEnums fetalEnums:FetalEnums.values()){ | |
19 | + if (fetalEnums.getId().equals(id)){ | |
20 | + return fetalEnums.getName(); | |
21 | + } | |
22 | + } | |
23 | + } | |
24 | + return null; | |
25 | + } | |
26 | + | |
13 | 27 | private FetalEnums(String name,String id){ |
14 | 28 | this.name=name; |
15 | 29 | this.id=id; |
platform-common/src/main/java/com/lyms/platform/common/enums/FetalPositionEnums.java
View file @
3e91392
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import org.apache.commons.lang.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * |
5 | 7 | * 胎方位枚举 |
... | ... | @@ -31,6 +33,18 @@ |
31 | 33 | ONE21("左肩后","21"), |
32 | 34 | ONE22("右肩前","22"), |
33 | 35 | ONE23("右肩后","23"); |
36 | + | |
37 | + public static String getTitle(String id){ | |
38 | + if (StringUtils.isNotEmpty(id)){ | |
39 | + for (FetalPositionEnums fetalPositionEnums:FetalPositionEnums.values()){ | |
40 | + if (fetalPositionEnums.getId().equals(id)){ | |
41 | + return fetalPositionEnums.getName(); | |
42 | + } | |
43 | + } | |
44 | + } | |
45 | + return null; | |
46 | + } | |
47 | + | |
34 | 48 | |
35 | 49 | private FetalPositionEnums(String name,String id){ |
36 | 50 | this.name=name; |
platform-common/src/main/java/com/lyms/platform/common/enums/JoinEnums.java
View file @
3e91392
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import org.apache.commons.lang.StringUtils; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 衔接枚举 |
5 | 7 | * <p> |
... | ... | @@ -9,6 +11,17 @@ |
9 | 11 | O("已衔接", "1"), |
10 | 12 | O1("未衔接", "2")/*, |
11 | 13 | O2("衔接", "3")*/; |
14 | + | |
15 | + public static String getTitle(String id){ | |
16 | + if (StringUtils.isNotEmpty(id)){ | |
17 | + for (JoinEnums joinEnums:JoinEnums.values()){ | |
18 | + if (joinEnums.getId().equals(id)){ | |
19 | + return joinEnums.getName(); | |
20 | + } | |
21 | + } | |
22 | + } | |
23 | + return null; | |
24 | + } | |
12 | 25 | |
13 | 26 | private JoinEnums(String name, String id) { |
14 | 27 | this.name = name; |
platform-common/src/main/java/com/lyms/platform/common/enums/TaiShuEnums.java
View file @
3e91392
... | ... | @@ -16,9 +16,11 @@ |
16 | 16 | O6("七胎","7"); |
17 | 17 | |
18 | 18 | public static String getTitle(String id){ |
19 | - for(TaiShuEnums enums:values()){ | |
20 | - if(enums.getId().equals(id)){ | |
21 | - return enums.getName(); | |
19 | + if (StringUtils.isNotEmpty(id)){ | |
20 | + for(TaiShuEnums enums:values()){ | |
21 | + if(enums.getId().equals(id)){ | |
22 | + return enums.getName(); | |
23 | + } | |
22 | 24 | } |
23 | 25 | } |
24 | 26 | return null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
3e91392
... | ... | @@ -18,10 +18,7 @@ |
18 | 18 | import org.apache.commons.lang.StringUtils; |
19 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
20 | 20 | import org.springframework.stereotype.Controller; |
21 | -import org.springframework.web.bind.annotation.RequestBody; | |
22 | -import org.springframework.web.bind.annotation.RequestMapping; | |
23 | -import org.springframework.web.bind.annotation.RequestMethod; | |
24 | -import org.springframework.web.bind.annotation.ResponseBody; | |
21 | +import org.springframework.web.bind.annotation.*; | |
25 | 22 | |
26 | 23 | import javax.servlet.http.HttpServletRequest; |
27 | 24 | import javax.servlet.http.HttpServletResponse; |
... | ... | @@ -252,5 +249,21 @@ |
252 | 249 | } |
253 | 250 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
254 | 251 | } |
252 | + | |
253 | + | |
254 | + //查询初诊接口 | |
255 | + | |
256 | + //查询复诊接口 | |
257 | + @RequestMapping(method = RequestMethod.GET, value = "/findAntenatalExamination") | |
258 | +// @TokenRequired | |
259 | + public BaseResponse findAntenatalExamination(@RequestParam("id")String id, | |
260 | + HttpServletRequest request){ | |
261 | + | |
262 | + return null; | |
263 | + } | |
264 | + | |
265 | + | |
266 | + | |
267 | + | |
255 | 268 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
3e91392
... | ... | @@ -2,11 +2,12 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | -import com.lyms.platform.common.enums.RiskDefaultTypeEnum; | |
6 | -import com.lyms.platform.common.enums.YnEnums; | |
5 | +import com.lyms.platform.common.enums.*; | |
7 | 6 | import com.lyms.platform.common.result.BaseListResponse; |
7 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
9 | 9 | import com.lyms.platform.common.utils.*; |
10 | +import com.lyms.platform.common.utils.StringUtils; | |
10 | 11 | import com.lyms.platform.operate.web.request.AntExManagerQueryRequest; |
11 | 12 | import com.lyms.platform.operate.web.request.CjStatisticsQueryRequest; |
12 | 13 | import com.lyms.platform.operate.web.result.AntExManagerResult; |
... | ... | @@ -14,6 +15,8 @@ |
14 | 15 | import com.lyms.platform.operate.web.result.CjStatisticsResult; |
15 | 16 | import com.lyms.platform.operate.web.result.HighScoreResult; |
16 | 17 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
18 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
19 | +import com.lyms.platform.operate.web.utils.UnitConstants; | |
17 | 20 | import com.lyms.platform.permission.model.Organization; |
18 | 21 | import com.lyms.platform.permission.model.OrganizationQuery; |
19 | 22 | import com.lyms.platform.permission.model.Users; |
... | ... | @@ -22,6 +25,8 @@ |
22 | 25 | import com.lyms.platform.pojo.*; |
23 | 26 | import com.lyms.platform.query.*; |
24 | 27 | import org.apache.commons.collections.CollectionUtils; |
28 | +import org.apache.commons.collections.MapUtils; | |
29 | +import org.apache.commons.lang.*; | |
25 | 30 | import org.apache.commons.lang.math.NumberUtils; |
26 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
27 | 32 | import org.springframework.data.domain.Sort; |
... | ... | @@ -567,5 +572,145 @@ |
567 | 572 | } |
568 | 573 | |
569 | 574 | } |
575 | + | |
576 | + | |
577 | + //查询复诊接口 | |
578 | + public BaseObjectResponse findAntenatalExamination(String id){ | |
579 | + | |
580 | + BaseObjectResponse br = new BaseObjectResponse(); | |
581 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
582 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
583 | + br.setErrormsg("id为空"); | |
584 | + return br; | |
585 | + } | |
586 | + | |
587 | + AntenatalExaminationModel data = antExService.findOneById(id); | |
588 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
589 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
590 | + br.setErrormsg("没有查询到数据"); | |
591 | + return br; | |
592 | + } | |
593 | + | |
594 | + | |
595 | + if (org.apache.commons.lang.StringUtils.isEmpty(data.getParentId())){ | |
596 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
597 | + br.setErrormsg("数据异常"); | |
598 | + return br; | |
599 | + } | |
600 | + | |
601 | + Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
602 | + if (patients==null || patients.getYn()==YnEnums.NO.getId()){ | |
603 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
604 | + br.setErrormsg("孕妇信息不存在"); | |
605 | + return br; | |
606 | + } | |
607 | + | |
608 | + Map<String,Object> map= new HashMap<>(); | |
609 | + /* 基本信息 */ | |
610 | + //孕妇基本信息 | |
611 | + map.put("id",data.getId()); | |
612 | + map.put("username",patients.getUsername()); | |
613 | + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
614 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
615 | + map.put("phone",patients.getPhone()); | |
616 | + map.put("fmWeek",patients.getFmWeek()); | |
617 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
618 | + map.put("mremark",patients.getMremark()); | |
619 | + map.put("oRiskFactor",patients.getoRiskFactor()); | |
620 | + map.put("riskScore",patients.getRiskScore()); | |
621 | + //产检基本信息 | |
622 | + map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate())); | |
623 | + map.put("currentDueDate",data.getCurrentDueDate()); | |
624 | + map.put("checkDoctor", data.getCheckDoctor()); | |
625 | + String hospital = ""; | |
626 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())){ | |
627 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
628 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
629 | + hospital = organization.getName(); | |
630 | + } | |
631 | + } | |
632 | + map.put("hospital", hospital); | |
633 | + map.put("nextCheckTime",DateUtil.getyyyy_MM_dd(data.getNextCheckTime())); | |
634 | + map.put("cDueWeek", data.getcDueWeek()); | |
635 | + | |
636 | + /* 复诊信息 */ | |
637 | + map.put("chiefComplaint", data.getChiefComplaint()); | |
638 | + map.put("weight", unitSplice(data.getWeight(),UnitConstants.KG)); | |
639 | + // 血压 | |
640 | + String ssy = ""; | |
641 | + String szy = ""; | |
642 | + Map<String, String> chBpMap = JsonUtil.getMap(data.getBp()); | |
643 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
644 | + ssy = chBpMap.get("ssy"); | |
645 | + szy = chBpMap.get("szy"); | |
646 | + } | |
647 | + map.put("bp", unitSplice(ssy + "/" + szy , UnitConstants.MMHG)); | |
648 | + map.put("gongGao", unitSplice(data.getGongGao(),UnitConstants.CM)); | |
649 | + map.put("abdominalCircumference", unitSplice(data.getAbdominalCircumference(),UnitConstants.CM)); | |
650 | + map.put("edema",""); | |
651 | + map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); | |
652 | + //胎儿情况 | |
653 | + List<Map> tireList = new ArrayList<>(); | |
654 | + if (CollectionUtils.isNotEmpty(data.getTireData())){ | |
655 | + for (Object temp : data.getTireData()){ | |
656 | + Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
657 | + String heartRate = tire.get("heartRate"); | |
658 | + String fetalPosition = tire.get("fetalPosition"); | |
659 | + String fetalPresentation = tire.get("fetalPresentation"); | |
660 | + String join = tire.get("join"); | |
661 | + | |
662 | + Map<String,Object> tireMap = new HashMap<>(); | |
663 | + tireMap.put("heartRate",unitSplice(heartRate,UnitConstants.CIFEN)); | |
664 | + tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); | |
665 | + tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); | |
666 | + tireMap.put("join", JoinEnums.getTitle(join)); | |
667 | + tireList.add(tireMap); | |
668 | + } | |
669 | + } | |
670 | + map.put("tireData",tireList); | |
671 | + | |
672 | + /* 辅助信息 */ | |
673 | + map.put("hemoglobin",unitSplice(data.getHemoglobin(),UnitConstants.GL)); | |
674 | + map.put("urineProtein",data.getUrineProtein()); | |
675 | + map.put("bloodSugar",unitSplice(data.getUrineProtein(),UnitConstants.MMOLL)); | |
676 | + map.put("bChao",data.getbChao());//TODO ????? | |
677 | + | |
678 | + /* 诊断指导 */ | |
679 | + String diagnosis = ""; | |
680 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getDiagnosis())){ | |
681 | + List<String> temp = JsonUtil.toList(data.getDiagnosis(), String.class); | |
682 | + if (CollectionUtils.isNotEmpty(temp)){ | |
683 | + | |
684 | + StringBuilder sb = new StringBuilder(); | |
685 | + | |
686 | + for (String sId : temp){ | |
687 | + sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(","); | |
688 | + } | |
689 | + if (sb.toString().endsWith(",")) { | |
690 | + diagnosis = sb.substring(0, sb.length() - 1); | |
691 | + }else { | |
692 | + diagnosis = sb.toString(); | |
693 | + } | |
694 | + } | |
695 | + } | |
696 | + map.put("diagnosis",diagnosis); | |
697 | + | |
698 | + | |
699 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
700 | + br.setErrormsg("成功"); | |
701 | + br.setData(map); | |
702 | + return br; | |
703 | + } | |
704 | + | |
705 | + //拼接单位 | |
706 | + public String unitSplice(Object data,String unit){ | |
707 | + if (data==null){ | |
708 | + return null; | |
709 | + } | |
710 | + return data.toString() + unit; | |
711 | + } | |
712 | + | |
713 | + | |
714 | + | |
570 | 715 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
3e91392
... | ... | @@ -1541,6 +1541,9 @@ |
1541 | 1541 | return newBabyManagerResult; |
1542 | 1542 | } |
1543 | 1543 | |
1544 | + @Autowired | |
1545 | + private CommonService commonService; | |
1546 | + | |
1544 | 1547 | public BaseObjectResponse findMatDeliverData(String id){ |
1545 | 1548 | |
1546 | 1549 | BaseObjectResponse br = new BaseObjectResponse(); |
... | ... | @@ -1582,7 +1585,20 @@ |
1582 | 1585 | map.put("fmWeek",patients.getFmWeek()); |
1583 | 1586 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
1584 | 1587 | map.put("mremark",patients.getMremark()); |
1585 | - map.put("oRiskFactor",patients.getoRiskFactor()); | |
1588 | + | |
1589 | + String riskFactor = ""; | |
1590 | + if (StringUtils.isNotEmpty(patients.getoRiskFactor())){ | |
1591 | + riskFactor = patients.getoRiskFactor(); | |
1592 | + } | |
1593 | + | |
1594 | + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ | |
1595 | + if (StringUtils.isEmpty(riskFactor)){ | |
1596 | + riskFactor = commonService.resloveFactor(patients.getRiskFactorId()); | |
1597 | + }else { | |
1598 | + riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId()); | |
1599 | + } | |
1600 | + } | |
1601 | + map.put("oRiskFactor",riskFactor); | |
1586 | 1602 | map.put("riskLevel", FunvCommonUtil.getBaseicConfigByid(patients.getRiskLevelId(),basicConfigService)); |
1587 | 1603 | map.put("riskScore",patients.getRiskScore()); |
1588 | 1604 | |
... | ... | @@ -1612,11 +1628,7 @@ |
1612 | 1628 | map.put("deliverDoctor", deliverDoctor); |
1613 | 1629 | |
1614 | 1630 | /* 分娩信息 */ |
1615 | - String tireNumber = ""; | |
1616 | - if (data.getTireNumber()!=null){ | |
1617 | - | |
1618 | - } | |
1619 | - map.put("tireNumber", tireNumber);//胎数 | |
1631 | + map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber() + ""));//胎数 | |
1620 | 1632 | map.put("placenta", data.getPlacenta());//胎盘 |
1621 | 1633 | |
1622 | 1634 | List<Map<String,Object>> placetaList = new ArrayList<>(); |
... | ... | @@ -1789,7 +1801,7 @@ |
1789 | 1801 | ExtPlacentaList.add(extMap); |
1790 | 1802 | } |
1791 | 1803 | } |
1792 | - map.put("ExtPlacentaList", ExtPlacentaList); | |
1804 | + map.put("extPlacentas", ExtPlacentaList); | |
1793 | 1805 | |
1794 | 1806 | //新生儿信息 |
1795 | 1807 | |
... | ... | @@ -1825,7 +1837,7 @@ |
1825 | 1837 | } |
1826 | 1838 | } |
1827 | 1839 | |
1828 | - map.put("babyList", babyList); | |
1840 | + map.put("baby", babyList); | |
1829 | 1841 | |
1830 | 1842 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
1831 | 1843 | br.setErrormsg("成功"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/UnitConstants.java
View file @
3e91392
1 | +package com.lyms.platform.operate.web.utils; | |
2 | + | |
3 | +/** | |
4 | + * | |
5 | + * 单位常量,用以返回值拼接 | |
6 | + * | |
7 | + * Created by Administrator on 2017/1/11 0011. | |
8 | + */ | |
9 | +public class UnitConstants { | |
10 | + | |
11 | + public static final String CM = " cm"; | |
12 | + public static final String KG = " kg"; | |
13 | + public static final String MMHG = " mmHg"; | |
14 | + public static final String CIFEN = " 次/分"; | |
15 | + public static final String GL = " g/L"; | |
16 | + public static final String MMOLL = " mmol/L"; | |
17 | + | |
18 | + | |
19 | +} |