Commit f0a88c7c8fc573feaf85b5e6afe855ef0aae33c7
1 parent
7a82d4f617
Exists in
master
and in
6 other branches
自动添加血压/体重
Showing 4 changed files with 84 additions and 9 deletions
- 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/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/MeasureInfoFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
f0a88c7
... | ... | @@ -84,6 +84,7 @@ |
84 | 84 | |
85 | 85 | /** |
86 | 86 | * 初诊B超同步接口 |
87 | + * | |
87 | 88 | * @param startDate |
88 | 89 | * @param endDate |
89 | 90 | * @return |
... | ... | @@ -91,8 +92,8 @@ |
91 | 92 | @RequestMapping(value = "/AntExChuSync", method = RequestMethod.GET) |
92 | 93 | @ResponseBody |
93 | 94 | public BaseObjectResponse AntExChuSync(@RequestParam("startDate") String startDate, |
94 | - @RequestParam("endDate") String endDate ) { | |
95 | - BaseObjectResponse br= antenatalExaminationFacade.AntExChuSync( startDate, endDate,true ); | |
95 | + @RequestParam("endDate") String endDate) { | |
96 | + BaseObjectResponse br = antenatalExaminationFacade.AntExChuSync(startDate, endDate, true); | |
96 | 97 | return br; |
97 | 98 | } |
98 | 99 | |
... | ... | @@ -952,7 +953,6 @@ |
952 | 953 | @ResponseBody |
953 | 954 | @TokenRequired |
954 | 955 | public BaseResponse checkReport(@RequestParam(required = false) List<String> antex, HttpServletRequest request) { |
955 | - | |
956 | 956 | |
957 | 957 | return viewFacade.checkReport(antex, getUserId(request)); |
958 | 958 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
f0a88c7
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | import com.lyms.platform.permission.model.Users; |
25 | 25 | import com.lyms.platform.permission.service.OrganizationService; |
26 | 26 | import com.lyms.platform.permission.service.UsersService; |
27 | +import com.lyms.platform.permission.service.impl.MeasureDataInfoServiceImpl; | |
27 | 28 | import com.lyms.platform.pojo.*; |
28 | 29 | import com.lyms.platform.query.*; |
29 | 30 | import jdk.nashorn.internal.ir.LiteralNode; |
... | ... | @@ -97,6 +98,9 @@ |
97 | 98 | @Autowired |
98 | 99 | private DzfyHisService dzfyHisService; |
99 | 100 | |
101 | + @Autowired | |
102 | + private MeasureDataInfoServiceImpl measureDataInfoService; | |
103 | + | |
100 | 104 | /** |
101 | 105 | * 组合查询请求 |
102 | 106 | * |
103 | 107 | |
... | ... | @@ -274,13 +278,11 @@ |
274 | 278 | patientsQuery.setQueryNo(antExManagerQueryRequest.getQueryNo()); |
275 | 279 | patientses = patientsService.queryPatient1(patientsQuery, "modpatientsQueryified"); |
276 | 280 | |
277 | - if (CollectionUtils.isEmpty(patientses)) | |
278 | - { | |
281 | + if (CollectionUtils.isEmpty(patientses)) { | |
279 | 282 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
280 | 283 | if ("1000000114".equals(hospitalId)) { |
281 | 284 | List<String> list = dzfyHisService.getDzVcCardNos(antExManagerQueryRequest.getQueryNo()); |
282 | - if (CollectionUtils.isNotEmpty(list)) | |
283 | - { | |
285 | + if (CollectionUtils.isNotEmpty(list)) { | |
284 | 286 | patientsQuery.setVcCardNos(list); |
285 | 287 | patientsQuery.setQueryNo(null); |
286 | 288 | patientses = patientsService.queryPatient1(patientsQuery, "modpatientsQueryified"); |
... | ... | @@ -912,7 +914,16 @@ |
912 | 914 | } |
913 | 915 | |
914 | 916 | /** |
915 | - * 小程序产检录入 | |
917 | + * 小程序创建产检 | |
918 | + * | |
919 | + * @param fuh | |
920 | + * @param abdominalGirth | |
921 | + * @param fhr | |
922 | + * @param pid | |
923 | + * @param hospitalId | |
924 | + * @param nextTime | |
925 | + * @param doctorId | |
926 | + * @return | |
916 | 927 | */ |
917 | 928 | public BaseResponse inputWxData(String fuh, String abdominalGirth, String fhr, String pid, String hospitalId, String nextTime, String doctorId) { |
918 | 929 | WxMeasureInfoModel wxMeasureInfo = new WxMeasureInfoModel(); |
... | ... | @@ -1027,6 +1038,29 @@ |
1027 | 1038 | } |
1028 | 1039 | } |
1029 | 1040 | antExAddRequest.setGuide(stringBuilder.toString()); |
1041 | + } | |
1042 | + //获取血压记录 | |
1043 | + BloodPressure one = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(patients.getId()).and("yn").is(1).and("hospitalId").is(hospitalId)), BloodPressure.class); | |
1044 | + if (one != null) { | |
1045 | + Map<String, Map<String, Object>> infos = one.getInfos(); | |
1046 | + Map<String, Object> map = infos.get(DateUtil.getyyyy_MM_dd(new Date())); | |
1047 | + if (map != null && map.size() > 0) { | |
1048 | + Map mapBp = new HashMap(); | |
1049 | + mapBp.put("ssy", map.get("ssy")); | |
1050 | + mapBp.put("szy", map.get("szy")); | |
1051 | + antExAddRequest.setBp(mapBp); | |
1052 | + } | |
1053 | + } | |
1054 | + //获取体重记录 | |
1055 | + PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId).and("patientId").is(patients.getId()).and("yn").is("1")), PatientWeight.class); | |
1056 | + if (patientWeight != null) { | |
1057 | + Map<String, String> dayWeights = patientWeight.getDayWeights(); | |
1058 | + if (null != dayWeights && dayWeights.size() > 0) { | |
1059 | + String valus = dayWeights.get(DateUtil.getyyyy_MM_dd(new Date())); | |
1060 | + if (StringUtils.isNotEmpty(value)) { | |
1061 | + antExAddRequest.setWeight(Double.valueOf(valus)); | |
1062 | + } | |
1063 | + } | |
1030 | 1064 | } |
1031 | 1065 | antenatalExaminationFacade.addOneAntEx(antExAddRequest, Integer.parseInt(doctorId)); |
1032 | 1066 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
f0a88c7
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
f0a88c7
... | ... | @@ -958,6 +958,24 @@ |
958 | 958 | Map<String, String> dayWeights = new LinkedHashMap<>(); |
959 | 959 | List<Map<String, Object>> dayWeights2 = new ArrayList<>(); |
960 | 960 | |
961 | + AntExQuery antExQuery = new AntExQuery(); | |
962 | + antExQuery.setYn(YnEnums.YES.getId()); | |
963 | + antExQuery.setParentId(patients.getId()); | |
964 | + antExQuery.setHospitalId(hospitalId); | |
965 | + String date = DateUtil.getyyyy_MM_dd(new Date()); | |
966 | + antExQuery.setStart(DateUtil.parseYMDHMS(date + " 00:00:00")); | |
967 | + antExQuery.setEnd(DateUtil.parseYMDHMS(date + " 23:59:59")); | |
968 | + List<AntenatalExaminationModel> antenatalExaminationModels = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
969 | + if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) { | |
970 | + AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
971 | + try { | |
972 | + examinationModel.setWeight(Double.valueOf(nutritionInfoRequest.getCurrentWeight())); | |
973 | + } catch (Exception e) { | |
974 | + | |
975 | + } | |
976 | + antenatalExaminationService.updateOneAnt(examinationModel, examinationModel.getId()); | |
977 | + } | |
978 | + | |
961 | 979 | String currentWeight = nutritionInfoRequest.getCurrentWeight(); |
962 | 980 | if (CollectionUtils.isNotEmpty(patientWeights)) { |
963 | 981 | PatientWeight pw = patientWeights.get(0); |
... | ... | @@ -1095,6 +1113,7 @@ |
1095 | 1113 | bloodPressure.setSzy(nutritionInfoRequest.getSzy()); |
1096 | 1114 | bloodPressure.setPulse(nutritionInfoRequest.getPulse()); |
1097 | 1115 | |
1116 | + | |
1098 | 1117 | String hospitalId = nutritionInfoRequest.getHospitalId(); |
1099 | 1118 | Map<String, Object> temp = new LinkedHashMap<>(); |
1100 | 1119 | bloodPressure.setModified(new Date()); |
... | ... | @@ -1119,6 +1138,7 @@ |
1119 | 1138 | Map<String, Map<String, Object>> infos = new LinkedHashMap<>(); |
1120 | 1139 | infos.put(DateUtil.getyyyy_MM_dd(new Date()), temp); |
1121 | 1140 | bloodPressure.setInfos(infos); |
1141 | + | |
1122 | 1142 | bloodPressureService.add(bloodPressure); |
1123 | 1143 | } else { |
1124 | 1144 | Map<String, Map<String, Object>> infos = bp.getInfos(); |
... | ... | @@ -1128,6 +1148,28 @@ |
1128 | 1148 | bloodPressure.setPid(bp.getPid()); |
1129 | 1149 | bloodPressureService.update(bloodPressure); |
1130 | 1150 | } |
1151 | + | |
1152 | + //复诊自动获取血压 | |
1153 | + AntExQuery antExQuery = new AntExQuery(); | |
1154 | + antExQuery.setYn(YnEnums.YES.getId()); | |
1155 | + antExQuery.setParentId(p.getId()); | |
1156 | + antExQuery.setHospitalId(hospitalId); | |
1157 | + String date = DateUtil.getyyyy_MM_dd(new Date()); | |
1158 | + antExQuery.setStart(DateUtil.parseYMDHMS(date + " 00:00:00")); | |
1159 | + antExQuery.setEnd(DateUtil.parseYMDHMS(date + " 23:59:59")); | |
1160 | + List<AntenatalExaminationModel> antenatalExaminationModels = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
1161 | + if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) { | |
1162 | + AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
1163 | + Map map = new HashMap(); | |
1164 | + map.put("szy", bloodPressure.getSzy()); | |
1165 | + map.put("ssy", bloodPressure.getSsy()); | |
1166 | + try { | |
1167 | + examinationModel.setBp(JsonUtil.obj2JsonString(map)); | |
1168 | + } catch (Exception e) { | |
1169 | + } | |
1170 | + antenatalExaminationService.updateOneAnt(examinationModel, examinationModel.getId()); | |
1171 | + } | |
1172 | + | |
1131 | 1173 | |
1132 | 1174 | MeasureInfoRequest measureInfoRequest = new MeasureInfoRequest(); |
1133 | 1175 | measureInfoRequest.setCertNo(p.getCardNo()); |