Commit a92a1b04c4fcfafee9a20749a887ac441c301e45

Authored by liquanyu
1 parent fbe4e18f02

update

Showing 5 changed files with 213 additions and 73 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/BabyDietSuggestModel.java View file @ a92a1b0
... ... @@ -25,6 +25,15 @@
25 25 private Integer monthAge;
26 26  
27 27 private List<List<String>> doctorSuggests;
  28 + private List<List<String>> qhdfyDoctorSuggests;
  29 +
  30 + public List<List<String>> getQhdfyDoctorSuggests() {
  31 + return qhdfyDoctorSuggests;
  32 + }
  33 +
  34 + public void setQhdfyDoctorSuggests(List<List<String>> qhdfyDoctorSuggests) {
  35 + this.qhdfyDoctorSuggests = qhdfyDoctorSuggests;
  36 + }
28 37  
29 38 public Integer getLevel() {
30 39 return level;
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/BabyAmsMsgGenerateWorker.java View file @ a92a1b0
... ... @@ -84,7 +84,7 @@
84 84 BabyModelQuery babyQuery = new BabyModelQuery();
85 85 babyQuery.setYn(YnEnums.YES.getId());
86 86 babyQuery.setHospitalId(hospitalId);
87   - babyQuery.setMphone("15833911677"); // 15027805358 17732261179 15930921847 13851409428 13175251837
  87 + // babyQuery.setMphone("15833911677"); // 15027805358 17732261179 15930921847 13851409428 13175251837
88 88  
89 89 List buildType = new ArrayList();
90 90 buildType.add(1);
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java View file @ a92a1b0
... ... @@ -540,11 +540,7 @@
540 540 babyQuery.setBirthEnd(endDate);
541 541 List<BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
542 542 for (BabyModel babyModel : babyModels){
543   - HashMap<String, Object> hashMap = getMapByParam(template, babyModel.getId(), true);
544   - List<Map> patientServices = patientServiceService.getPatientServices(hashMap);
545   - if (CollectionUtils.isNotEmpty(patientServices)){
546   - addBabyRemindMonthMessages(template, config, service, tempHid, sendTimeType, messages, start, end, babyModel);
547   - }
  543 + addBabyRemindMonthMessages(template, config, service, tempHid, sendTimeType, messages, start, end, babyModel);
548 544 }
549 545 }
550 546  
... ... @@ -852,11 +848,7 @@
852 848 } else {
853 849 List<BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
854 850 for (BabyModel babyModel : babyModels) {
855   - HashMap<String, Object> hashMap = getMapByParam(template, babyModel.getId(), true);
856   - List<Map> patientServices = patientServiceService.getPatientServices(hashMap);
857   - if (CollectionUtils.isNotEmpty(patientServices)){
858   - addBabyVaccineDayOrMonthMessages(template, config, service, messages, start, babyModel, isDay);
859   - }
  851 + addBabyVaccineDayOrMonthMessages(template, config, service, messages, start, babyModel, isDay);
860 852 }
861 853 }
862 854 }
... ... @@ -1456,18 +1448,7 @@
1456 1448  
1457 1449 List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(query);
1458 1450 for (Patients patient: patients){
1459   -
1460   - HashMap<String, Object> mapByParam = getMapByParam(template, patient.getId(), false);
1461   - List<Map> mapList = patientServiceService.getPatientServices(mapByParam);
1462   - for (Map map: mapList){
1463   - String parentId = map.get("parentId").toString();
1464   - PatientsQuery patientQ = new PatientsQuery();
1465   - patientQ.setId(parentId);
1466   - List<Patients> patientsList = yunBookbuildingService.queryPregnantWithQuery(patientQ);
1467   - for (Patients p: patientsList){
1468   - makeSmsDataByPatients(template, config, service, messages, p, keyword1, keyword2, remark);
1469   - }
1470   - }
  1451 + makeSmsDataByPatients(template, config, service, messages, patient, keyword1, keyword2, remark);
1471 1452 }
1472 1453 return;
1473 1454 }
... ... @@ -1654,20 +1635,20 @@
1654 1635 return 4;
1655 1636 }
1656 1637  
1657   - private HashMap<String, Object> getMapByParam(SmsTemplateModel templateModel, String id, Boolean isBaby) {
1658   - Integer serviceStatus = templateModel.getServiceStatus();
1659   - Integer serviceType = templateModel.getServiceType();
1660   - Integer serType = compatibleOldData(serviceType, isBaby);
1661   - Integer status = getServiceStatus(serviceStatus);
1662   - HashMap<String, Object> hashMap = new HashMap<>(16);
1663   - if (StringUtils.isNotEmpty(id)){
1664   - hashMap.put("parentId", id);
1665   - }
1666   - hashMap.put("serStatus", status);
1667   - hashMap.put("serType",serType);
1668   - hashMap.put("perType", isBaby ? 2 : 1);
1669   - return hashMap;
1670   - }
  1638 +// private HashMap<String, Object> getMapByParam(SmsTemplateModel templateModel, String id, Boolean isBaby) {
  1639 +// Integer serviceStatus = templateModel.getServiceStatus();
  1640 +// Integer serviceType = templateModel.getServiceType();
  1641 +// Integer serType = compatibleOldData(serviceType, isBaby);
  1642 +// Integer status = getServiceStatus(serviceStatus);
  1643 +// HashMap<String, Object> hashMap = new HashMap<>(16);
  1644 +// if (StringUtils.isNotEmpty(id)){
  1645 +// hashMap.put("parentId", id);
  1646 +// }
  1647 +// hashMap.put("serStatus", status);
  1648 +// hashMap.put("serType",serType);
  1649 +// hashMap.put("perType", isBaby ? 2 : 1);
  1650 +// return hashMap;
  1651 +// }
1671 1652  
1672 1653 /**
1673 1654 * 产检过期消息
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java View file @ a92a1b0
... ... @@ -966,6 +966,64 @@
966 966 }
967 967  
968 968  
  969 + private String getBabyStatus1(int month, int sex, Double weight, Double hegiht, String bmi) {
  970 + String kaupEvaluate = "";
  971 + if (weight != null && hegiht != null) {
  972 +
  973 + if (StringUtils.isNotEmpty(bmi)) {
  974 + Double bbmi = Double.parseDouble(bmi);
  975 + //查询该月龄的年龄别体重值
  976 + // 正常 :-2SD ≤ A ≤ +1SD
  977 + // 消瘦 : A < -2SD
  978 + //偏重 : A > +1SD
  979 + List<AwModel> list = babyCheckService.queryBabyHealthConfig(month, sex, 5);
  980 + if (CollectionUtils.isNotEmpty(list)) {
  981 + AwModel awModel = list.get(0);
  982 + if (awModel.getMiddleDs() == bbmi)
  983 + {
  984 + kaupEvaluate = "正常";
  985 + }
  986 + else if (awModel.getMiddleDs() > bbmi && awModel.getRoneDs() <= bbmi)
  987 + {
  988 + kaupEvaluate = "中-";
  989 + }
  990 + else if (awModel.getRoneDs() > bbmi && awModel.getRtwoDs() <= bbmi)
  991 + {
  992 + kaupEvaluate = "中下";
  993 + }
  994 + else if ( awModel.getRtwoDs() > bbmi)
  995 + {
  996 + kaupEvaluate = "下";
  997 + }
  998 +
  999 + else if (awModel.getMiddleDs() < bbmi && awModel.getPoneDs() >= bbmi)
  1000 + {
  1001 + kaupEvaluate = "中+";
  1002 + }
  1003 + else if (awModel.getPoneDs() < bbmi && awModel.getPtwoDs() >= bbmi)
  1004 + {
  1005 + kaupEvaluate = "中上";
  1006 + }
  1007 + else if ( awModel.getPtwoDs() < bbmi)
  1008 + {
  1009 + kaupEvaluate = "上";
  1010 + }
  1011 +
  1012 +
  1013 +// if (awModel.getPoneDs() < bbmi) {
  1014 +// kaupEvaluate = "超重";
  1015 +// } else if (awModel.getPoneDs() >= bbmi && awModel.getRtwoDs() <= bbmi) {
  1016 +// kaupEvaluate = "正常";
  1017 +// } else if (awModel.getRtwoDs() > bbmi) {
  1018 +// kaupEvaluate = "消瘦";
  1019 +// }
  1020 + }
  1021 + }
  1022 + }
  1023 + return kaupEvaluate;
  1024 + }
  1025 +
  1026 +
969 1027 /**
970 1028 * 未结算列表
971 1029 *
972 1030  
973 1031  
... ... @@ -1837,12 +1895,18 @@
1837 1895 Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId));
1838 1896 map.put("hospitalName", org.getName());
1839 1897 map.put("reportMonthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(baby.getBirth(), model.getNutritiTime())));
  1898 +
  1899 +
  1900 + Map <String, String> weightRes = babyCheckFacade.getGrowthValueMapNew(DateUtil.getyyyy_MM_dd(baby.getBirth())
  1901 + , model.getWeight(), baby.getSex(), null, baby.getId(), DateUtil.getyyyy_MM_dd(model.getNutritiTime()));
  1902 +
  1903 + Map <String, String> heightRes = babyCheckFacade.getGrowthValue1MapNew(DateUtil.getyyyy_MM_dd(baby.getBirth())
  1904 + , model.getHeight(), baby.getSex(), null, baby.getId(), DateUtil.getyyyy_MM_dd(model.getNutritiTime()));
  1905 +
1840 1906 //体重评价
1841   - String weightEvaluate = babyCheckFacade.getGrowthValue(DateUtil.getyyyy_MM_dd(baby.getBirth()), model.getWeight(), baby.getSex(), null, null, DateUtil.getyyyy_MM_dd(model.getNutritiTime()));
1842   - map.put("weightEvaluate", weightEvaluate);
  1907 + map.put("weightEvaluate", weightRes.get("res"));
1843 1908 //身高评价
1844   - String heightEvaluate = babyCheckFacade.getGrowthValue1(DateUtil.getyyyy_MM_dd(baby.getBirth()), model.getHeight(), baby.getSex(), 1, null, DateUtil.getyyyy_MM_dd(model.getNutritiTime()));
1845   - map.put("heightEvaluate", heightEvaluate);
  1909 + map.put("heightEvaluate", heightRes.get("res"));
1846 1910 int month = DateUtil.getMonth(baby.getBirth(), model.getNutritiTime());
1847 1911 if (month > 60) {
1848 1912 return new BaseObjectResponse().setData(data).setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("月龄范围没有报告");
... ... @@ -1857,6 +1921,51 @@
1857 1921 double kaul = getKcal(month, model.getWeight(), model.getHeight(), baby.getSex(), kaupEvaluate);
1858 1922  
1859 1923  
  1924 + //总体评价
  1925 + String totalEvaluate = "";
  1926 + String totalSuggest = "";
  1927 + boolean weightDb = false;
  1928 + if ("中下".equals(heightRes.get("res")) || "下".equals(heightRes.get("res")))
  1929 + {
  1930 + totalEvaluate+="身长未达标 ";
  1931 + weightDb = true;
  1932 + }
  1933 +
  1934 + boolean heightDb = false;
  1935 + if ("中下".equals(weightRes.get("res")) || "下".equals(weightRes.get("res")))
  1936 + {
  1937 + totalEvaluate+="体重未达标 ";
  1938 + heightDb = true;
  1939 + }
  1940 +
  1941 + boolean bmiDb = false;
  1942 + if (!"正常".equals(kaupEvaluate))
  1943 + {
  1944 + totalEvaluate+="BMI未在正常范围之内 ";
  1945 + bmiDb = true;
  1946 + }
  1947 + if (weightDb && heightDb && bmiDb)
  1948 + {
  1949 + totalSuggest = "宝宝综合评价中有三项未达标,建议进一步咨询体检医生。";
  1950 + }
  1951 + else if ((weightDb && heightDb) || (weightDb && bmiDb) || (heightDb && bmiDb))
  1952 + {
  1953 + totalSuggest = "宝宝综合评价中有两项未达标,建议进一步咨询体检医生。";
  1954 + }
  1955 + else if (weightDb)
  1956 + {
  1957 + totalSuggest = "宝宝综合评价中体重未达标,建议进一步咨询体检医生。";
  1958 + }
  1959 + else if (heightDb)
  1960 + {
  1961 + totalSuggest = "宝宝综合评价中身长未达标,建议进一步咨询体检医生。";
  1962 + }
  1963 +
  1964 +
  1965 + map.put("totalEvaluate", totalEvaluate);
  1966 + map.put("totalSuggest", totalSuggest);
  1967 +
  1968 + //5月龄按照6月龄来取内容
1860 1969 if (month == 5)
1861 1970 {
1862 1971 month = 6;
1863 1972  
... ... @@ -2070,15 +2179,16 @@
2070 2179 }
2071 2180 });
2072 2181  
2073   - int items = 0;
  2182 + int start = 0;
  2183 + int end = 0;
2074 2184 switch (month) {
2075   - case 6: items = 4;break;
2076   - case 7: items = 15;break;
2077   - case 8: items = 20;break;
2078   - case 9: items = 20;break;
2079   - case 10: items = 23;break;
2080   - case 11: items = 23;break;
2081   - case 12: items = 24;break;
  2185 + case 6: start = 0;end = 4;break;
  2186 + case 7: start = 7;end = 14;break;
  2187 + case 8: start = 15;end = 21;break;
  2188 + case 9: start = 22;end = 28;break;
  2189 + case 10: start = 29;end = 37;break;
  2190 + case 11: start = 38;end =46;break;
  2191 + case 12: start = 47;end = 55;break;
2082 2192 }
2083 2193  
2084 2194 List<List<String>> dss = new ArrayList<>();
... ... @@ -2087,8 +2197,8 @@
2087 2197  
2088 2198 //获取对应月龄的医生建议
2089 2199 BabyDietSuggestModel dietDoctorSuggests = mongoTemplate.findOne(Query.query(Criteria.where("type").is(1).and("monthAge").is(month)), BabyDietSuggestModel.class);
2090   - List<List<String>> doctorSuggests = dietDoctorSuggests.getDoctorSuggests();
2091   - List<Map<String,Integer>> tempList = list.subList(0, items);
  2200 + List<List<String>> doctorSuggests = dietDoctorSuggests.getQhdfyDoctorSuggests();
  2201 + List<Map<String,Integer>> tempList = list.subList(start, end);
2092 2202 for (int i = 0; i < tempList.size() ; i++)
2093 2203 {
2094 2204 //没有添加对应月龄的食物 add 0 为未添加 1为添加
2095 2205  
... ... @@ -2115,7 +2225,10 @@
2115 2225 }
2116 2226  
2117 2227 healthChargeFacade.addHealthCharge(hospitalId, 5, baby.getId(), null, null, userId, doctorId, true, model.getId());
  2228 +
  2229 + map.put("kaupEvaluate", getBabyStatus(month, baby.getSex(), model.getHeight(), model.getWeight(), bmi));
2118 2230 }
  2231 +
2119 2232 objectResponse.setData(data);
2120 2233 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
2121 2234 objectResponse.setErrormsg("成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ a92a1b0
... ... @@ -26,7 +26,7 @@
26 26 import com.lyms.platform.operate.web.result.*;
27 27 import com.lyms.platform.operate.web.utils.*;
28 28 import com.lyms.platform.operate.web.utils.UnitConstants;
29   -import com.lyms.platform.permission.model.CheckItem;
  29 +import com.lyms.platform.permission.model.*;
30 30 import com.lyms.platform.permission.service.CheckItemService;
31 31 import net.sf.json.JSONArray;
32 32 import org.apache.commons.collections.CollectionUtils;
... ... @@ -73,9 +73,6 @@
73 73 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
74 74 import com.lyms.platform.operate.web.service.BabyEvaluationCriterionService;
75 75 import com.lyms.platform.permission.dao.master.CouponMapper;
76   -import com.lyms.platform.permission.model.Organization;
77   -import com.lyms.platform.permission.model.OrganizationQuery;
78   -import com.lyms.platform.permission.model.Users;
79 76 import com.lyms.platform.permission.service.CouponService;
80 77 import com.lyms.platform.permission.service.OrganizationService;
81 78 import com.lyms.platform.permission.service.UsersService;
82 79  
83 80  
84 81  
85 82  
... ... @@ -7726,27 +7723,67 @@
7726 7723 map.put("abdominalCircumference", antExChuModel.getFuwei());
7727 7724 List <Map> tireList = new ArrayList <>();
7728 7725 if (CollectionUtils.isNotEmpty(antExChuModel.getPlacentas())) {
7729   - for (Object temp : antExChuModel.getPlacentas()) {
7730   - if (temp != null)
7731   - {
7732   - Map <String, Object> tire = (Map <String, Object>) temp;
7733   - if (tire != null) {
7734   - String heartRate = tire.get("heartRate") == null ? "" : String.valueOf(tire.get("heartRate"));
7735   - String fetalPosition = tire.get("fetalPosition") + "";
7736   - String fetalPresentation = tire.get("fetalPresentation") + "";
7737   - String join = tire.get("join") + "";
  7726 + List <MatDeliverAddRequest.Placenta> placentas = antExChuModel.getPlacentas();
  7727 + if (CollectionUtils.isNotEmpty(placentas)) {
  7728 + for (Object obj : placentas) {
  7729 + Map <String, Object> placetaMap = new HashMap <>();
  7730 + String fetalPosition = "";
  7731 + String fetalPresentation = "";
  7732 + String heartRate = "";
  7733 + String join = "";
7738 7734  
7739   - Map <String, Object> tireMap = new HashMap <>();
  7735 + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) {
  7736 + //转换类型
  7737 + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj;
  7738 + //胎方位
  7739 + if (StringUtils.isNotEmpty(placenta.getFetalPosition())) {
  7740 + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
  7741 + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
  7742 + fetalPosition += fetalPositionEnums.getName();
  7743 + break;
  7744 + }
  7745 + }
  7746 + }
  7747 + //胎先露
  7748 + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation();
  7749 + //胎心率
  7750 + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString();
7740 7751 if (StringUtils.isNotEmpty(heartRate)) {
7741   - tireMap.put("heartRate", UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN));
7742   - } else {
7743   - tireMap.put("heartRate", "");
  7752 + Integer a = (int) Double.parseDouble(heartRate);
  7753 + heartRate = String.valueOf(a);
7744 7754 }
7745   - tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition));
7746   - tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation));
7747   - tireMap.put("join", JoinEnums.getTitle(join));
7748   - tireList.add(tireMap);
  7755 + join = placenta.getJoin();
  7756 +
7749 7757 }
  7758 +
  7759 + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) {
  7760 + Map <String, Object> placenta = (Map <String, Object>) obj;
  7761 + if (MapUtils.isNotEmpty(placenta)) {
  7762 + if (placenta.get("fetalPosition") != null) {
  7763 + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
  7764 + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
  7765 + fetalPosition += fetalPositionEnums.getName();
  7766 + break;
  7767 + }
  7768 + }
  7769 + }
  7770 + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate");
  7771 + if (StringUtils.isNotEmpty(heartRate)) {
  7772 + Integer a = (int) Double.parseDouble(heartRate);
  7773 + heartRate = String.valueOf(a);
  7774 + }
  7775 + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation");
  7776 + join = String.valueOf(placenta.get("join"));
  7777 +
  7778 + }
  7779 + }
  7780 +
  7781 + placetaMap.put("fetalPosition", fetalPosition);
  7782 + placetaMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation));
  7783 + placetaMap.put("heartRate", UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN));
  7784 + placetaMap.put("join", JoinEnums.getTitle(join));
  7785 +
  7786 + tireList.add(placetaMap);
7750 7787 }
7751 7788 }
7752 7789 }