Commit 938e5813f43cf5cf22190e043ed8be136c8f945a

Authored by liquanyu
1 parent a48e9066f3

补录产检

Showing 6 changed files with 119 additions and 50 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java View file @ 938e581
... ... @@ -162,6 +162,29 @@
162 162 // System.out.println(tzzs);
163 163 // System.out.println(df.format(tzzs));
164 164  
  165 +
  166 + System.out.println(getLevel(11));
  167 + System.out.println(8&11);
  168 +
  169 + }
  170 +
  171 +
  172 + public static Integer getLevel(Integer total) {
  173 + if (total == null) {
  174 + return 0;
  175 + } else if (total == 0) {
  176 + return 0;
  177 + } else if ((total&8)==8) {
  178 + return 8;
  179 + } else if ((total&4)==4) {
  180 + return 4;
  181 + } else if ((total&1)==1) {
  182 + return 1;
  183 + } else if ((total&2)==2) {
  184 + return 2;
  185 + } else {
  186 + return 0;
  187 + }
165 188 }
166 189  
167 190 public static void configData(BasicConfig bs, List<BasicConfig> basicConfigList,Map<String, List<BasicConfig>> slaveBasicConfigMap) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java View file @ 938e581
... ... @@ -158,8 +158,8 @@
158 158 */
159 159 @ResponseBody
160 160 @RequestMapping(value = "/last/check", method = RequestMethod.GET)
161   - public BaseResponse patientLastCheck(String pid) {
162   - return patientWeightService.lastCheckTime(pid);
  161 + public BaseResponse patientLastCheck(String pid,@RequestParam(required = false) String time) {
  162 + return patientWeightService.lastCheckTime(pid,time);
163 163 }
164 164  
165 165 /**
... ... @@ -170,8 +170,8 @@
170 170 */
171 171 @ResponseBody
172 172 @RequestMapping(value = "/recipe/info", method = RequestMethod.GET)
173   - public BaseResponse patientRecipeInfo(String pid) {
174   - return patientWeightService.patientRecipeInfo(pid, 2);
  173 + public BaseResponse patientRecipeInfo(String pid,@RequestParam(required = false) String time) {
  174 + return patientWeightService.patientRecipeInfo(pid, 2,time);
175 175 }
176 176  
177 177 /**
... ... @@ -182,8 +182,8 @@
182 182 */
183 183 @ResponseBody
184 184 @RequestMapping(value = "/suggest/info", method = RequestMethod.GET)
185   - public BaseResponse patientSuggestInfo(String pid) {
186   - return patientWeightService.patientRecipeInfo(pid, 3);
  185 + public BaseResponse patientSuggestInfo(String pid,@RequestParam(required = false) String time) {
  186 + return patientWeightService.patientRecipeInfo(pid, 3,time);
187 187 }
188 188  
189 189 /**
... ... @@ -194,8 +194,8 @@
194 194 */
195 195 @ResponseBody
196 196 @RequestMapping(value = "/guide/info", method = RequestMethod.GET)
197   - public BaseResponse patientGuideInfo(String pid) {
198   - return patientWeightService.patientRecipeInfo(pid, 1);
  197 + public BaseResponse patientGuideInfo(String pid,@RequestParam(required = false) String time) {
  198 + return patientWeightService.patientRecipeInfo(pid, 1,time);
199 199 }
200 200  
201 201 /**
... ... @@ -206,8 +206,8 @@
206 206 */
207 207 @ResponseBody
208 208 @RequestMapping(value = "/cookbook/info", method = RequestMethod.GET)
209   - public BaseResponse patientCookbookInfo(String pid) {
210   - return patientWeightService.patientRecipeInfo(pid, 4);
  209 + public BaseResponse patientCookbookInfo(String pid,@RequestParam(required = false) String time) {
  210 + return patientWeightService.patientRecipeInfo(pid, 4,time);
211 211 }
212 212  
213 213  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 938e581
... ... @@ -3116,5 +3116,15 @@
3116 3116 }
3117 3117 }
3118 3118  
  3119 +
  3120 + @RequestMapping(value = "/his/getGkyyIdByIdCard", method = RequestMethod.GET)
  3121 + @ResponseBody
  3122 + public Map getGkyyIdByIdCard(@RequestParam(required = true) String vcCardNo)
  3123 + {
  3124 + Map<String,String> map = new HashMap<>();
  3125 + map.put("id,","2134123412431");
  3126 + return map;
  3127 + }
  3128 +
3119 3129 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java View file @ 938e581
... ... @@ -258,43 +258,53 @@
258 258 lises = queryLisWhfyData(vcCardNo, cardNo,model);
259 259 }
260 260 else {
261   - PatientsQuery patientsQuery = new PatientsQuery();
262   - String[] strs = new String[]{phone, vcCardNo, cardNo};
263   - patientsQuery.setPv(strs);
264   - patientsQuery.setHospitalId(hospitalId);
265   - patientsQuery.setYn(YnEnums.YES.getId());
266   - //通过医院id和就诊卡号或者手机号码查询到孕妇信息
267   - List<Patients> list = patientsService.queryPatient(patientsQuery);
268   - if (CollectionUtils.isNotEmpty(list)) {
269   - Patients patients = list.get(0);
270   - patientsQuery.setPid(patients.getPid());
271   - patientsQuery.setVcCardNo(null);
272   - patientsQuery.setHospitalId(null);
273   - patientsQuery.setPv(null);
274 261  
275   - //通过上面就诊号查询到的人的所有建档记录 包括其他医院的建档记录
276   - list = patientsService.queryPatient(patientsQuery);
  262 + //秦皇岛港口医院
  263 + if ("216".equals(hospitalId))
  264 + {
  265 + //通过就诊卡号和医院id查询到医院下面的lis记录
  266 + lises = queryLisData(vcCardNo, phone, cardNo,perType, model);
  267 + }
  268 + else
  269 + {
  270 + PatientsQuery patientsQuery = new PatientsQuery();
  271 + String[] strs = new String[]{phone, vcCardNo, cardNo};
  272 + patientsQuery.setPv(strs);
  273 + patientsQuery.setHospitalId(hospitalId);
  274 + patientsQuery.setYn(YnEnums.YES.getId());
  275 + //通过医院id和就诊卡号或者手机号码查询到孕妇信息
  276 + List<Patients> list = patientsService.queryPatient(patientsQuery);
277 277 if (CollectionUtils.isNotEmpty(list)) {
278   - for (Patients pat : list) {
279   - if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId())) {
  278 + Patients patients = list.get(0);
  279 + patientsQuery.setPid(patients.getPid());
  280 + patientsQuery.setVcCardNo(null);
  281 + patientsQuery.setHospitalId(null);
  282 + patientsQuery.setPv(null);
280 283  
281   - if (StringUtils.isEmpty(pat.getVcCardNo()) && StringUtils.isEmpty(pat.getPhone()) && StringUtils.isEmpty(pat.getCardNo())) {
282   - continue;
283   - }
  284 + //通过上面就诊号查询到的人的所有建档记录 包括其他医院的建档记录
  285 + list = patientsService.queryPatient(patientsQuery);
  286 + if (CollectionUtils.isNotEmpty(list)) {
  287 + for (Patients pat : list) {
  288 + if (pat != null && StringUtils.isNotEmpty(pat.getHospitalId())) {
284 289  
285   - //获取医院的名称
286   - hospitalName = hIdNames.get(pat.getHospitalId());
287   - if (!StringUtils.isNotEmpty(hospitalName)) {
288   - organizationQuery.setId(Integer.parseInt(pat.getHospitalId()));
289   - List<Organization> hospitals = organizationService.queryOrganization(organizationQuery);
290   - if (CollectionUtils.isNotEmpty(hospitals)) {
291   - hospitalName = hospitals.get(0).getName();
292   - hIdNames.put(hospitals.get(0).getId() + "", hospitalName);
  290 + if (StringUtils.isEmpty(pat.getVcCardNo()) && StringUtils.isEmpty(pat.getPhone()) && StringUtils.isEmpty(pat.getCardNo())) {
  291 + continue;
293 292 }
  293 +
  294 + //获取医院的名称
  295 + hospitalName = hIdNames.get(pat.getHospitalId());
  296 + if (!StringUtils.isNotEmpty(hospitalName)) {
  297 + organizationQuery.setId(Integer.parseInt(pat.getHospitalId()));
  298 + List<Organization> hospitals = organizationService.queryOrganization(organizationQuery);
  299 + if (CollectionUtils.isNotEmpty(hospitals)) {
  300 + hospitalName = hospitals.get(0).getName();
  301 + hIdNames.put(hospitals.get(0).getId() + "", hospitalName);
  302 + }
  303 + }
  304 + model.setHospitalId(pat.getHospitalId());
  305 + //通过就诊卡号和医院id查询到医院下面的lis记录
  306 + lises = queryLisData(pat.getVcCardNo(), pat.getPhone(), pat.getCardNo(),perType, model);
294 307 }
295   - model.setHospitalId(pat.getHospitalId());
296   - //通过就诊卡号和医院id查询到医院下面的lis记录
297   - lises = queryLisData(pat.getVcCardNo(), pat.getPhone(), pat.getCardNo(),perType, model);
298 308 }
299 309 }
300 310 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java View file @ 938e581
... ... @@ -13,9 +13,9 @@
13 13  
14 14 BaseResponse findRiskDietaryPrinciples(String patientId);
15 15  
16   - BaseResponse lastCheckTime(String pid);
  16 + BaseResponse lastCheckTime(String pid,String time);
17 17 BaseResponse init();
18   - BaseResponse patientRecipeInfo(String pid,Integer type);
  18 + BaseResponse patientRecipeInfo(String pid,Integer type,String time);
19 19 BaseResponse addOrUpdate(Integer userId, PatientWeight patientWeight);
20 20  
21 21 BaseResponse list(String key, String vcCardNo, Integer currentWeekStart, Integer currentWeekEnd, Integer age, Integer page, Integer limit, Integer userId);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 938e581
... ... @@ -420,19 +420,29 @@
420 420 return patientWeight;
421 421 }
422 422  
423   - public BaseResponse lastCheckTime(String pid) {
  423 + public BaseResponse lastCheckTime(String pid,String time) {
424 424 PatientWeight patientWeight = queryPatientWeight(pid);
425 425 Integer week = 0;
426 426 if (null != patientWeight) {
427 427 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
428 428 if (patients != null) {
429   - week = DateUtil.getWeek2(patients.getLastMenses(), patientWeight.getModified());
  429 +
  430 + Date recordDate = patientWeight.getModified();
  431 + Map<String, String> dayWeights = patientWeight.getDayWeights();
  432 + if (dayWeights != null && dayWeights.size() > 0)
  433 + {
  434 + if (StringUtils.isNotEmpty(dayWeights.get(time)))
  435 + {
  436 + recordDate = DateUtil.parseYMD(time);
  437 + }
  438 + }
  439 + week = DateUtil.getWeek2(patients.getLastMenses(), recordDate);
430 440 }
431 441 }
432 442 return new BaseObjectResponse().setData(week).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
433 443 }
434 444  
435   - public BaseResponse patientRecipeInfo(String pid, Integer type) {
  445 + public BaseResponse patientRecipeInfo(String pid, Integer type,String time) {
436 446 PatientWeight patientWeight = queryPatientWeight(pid);
437 447 Map<String, Object> map = new LinkedHashMap<>();
438 448 if (null != patientWeight) {
... ... @@ -441,7 +451,23 @@
441 451 Integer week = null;
442 452  
443 453 if (patients != null) {
444   - week = DateUtil.getWeek2(patients.getLastMenses(), new Date());
  454 +
  455 + String nowWeight = patientWeight.getNowWeight();
  456 + Date recordDate = new Date();
  457 + if (StringUtils.isNotEmpty(time))
  458 + {
  459 + Map<String, String> dayWeights = patientWeight.getDayWeights();
  460 + if (dayWeights != null && dayWeights.size() > 0)
  461 + {
  462 + if (StringUtils.isNotEmpty(dayWeights.get(time)))
  463 + {
  464 + nowWeight = dayWeights.get(time);
  465 + recordDate = DateUtil.parseYMD(time);
  466 + }
  467 + }
  468 + }
  469 +
  470 + week = DateUtil.getWeek2(patients.getLastMenses(), recordDate);
445 471 BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(org.getProvinceId());
446 472 if (week != null && StringUtils.isNotEmpty(patientWeight.getBmi())) {
447 473  
... ... @@ -449,7 +475,7 @@
449 475 if (week > 5 && week < 41) {
450 476 double bmi = Double.parseDouble(patientWeight.getBmi());
451 477 Map<String, String> kmap = getComputeKul(Double.parseDouble(patientWeight.getBeforeWeight()),
452   - Double.parseDouble(patientWeight.getNowWeight()), week, bmi, patientWeight.getBregmatic());
  478 + Double.parseDouble(nowWeight), week, bmi, patientWeight.getBregmatic());
453 479  
454 480 if (1 == type) {
455 481 setGuide(week, map,patientWeight.getHospitalId()); // 设置指南