Commit 641ae57ba06ee27b464ec28edf6567d7e28750ed
1 parent
f9274d73a1
Exists in
master
and in
1 other branch
儿童筛查-新生儿及家长基本信息接口
Showing 2 changed files with 87 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
641ae57
| ... | ... | @@ -1103,6 +1103,25 @@ |
| 1103 | 1103 | |
| 1104 | 1104 | return viewFacade.getBabyScreeningInfo(blNo); |
| 1105 | 1105 | } |
| 1106 | + /** | |
| 1107 | + * 通过请求接口返回本院新生儿及家长的基本信息 | |
| 1108 | + * | |
| 1109 | + * @param cardNo | |
| 1110 | + * @param Authorization | |
| 1111 | + * @Author: 武涛涛 | |
| 1112 | + * @Date: 2020/11/9 16:05 | |
| 1113 | + */ | |
| 1114 | + @RequestMapping(value = "/getBabyScreening", method = RequestMethod.GET) | |
| 1115 | + @ResponseBody | |
| 1116 | + public BaseObjectResponse getBabyScreening(@RequestParam(required = true) String cardNo, | |
| 1117 | + @RequestHeader(required = true) String Authorization) { | |
| 1118 | + if (StringUtils.isEmpty(Authorization) || !"1a8152fc04c86b9cca3244e0e52ecb33".equals(Authorization)) | |
| 1119 | + { | |
| 1120 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Authorization验证失败"); | |
| 1121 | + } | |
| 1122 | + | |
| 1123 | + return viewFacade.getBabyScreening(cardNo); | |
| 1124 | + } | |
| 1106 | 1125 | |
| 1107 | 1126 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
641ae57
| ... | ... | @@ -7902,6 +7902,74 @@ |
| 7902 | 7902 | } |
| 7903 | 7903 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(data); |
| 7904 | 7904 | } |
| 7905 | + public BaseObjectResponse getBabyScreening(String cardNo) { | |
| 7906 | + | |
| 7907 | + if (StringUtils.isEmpty(cardNo)) { | |
| 7908 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("身份证号码不能为空"); | |
| 7909 | + } | |
| 7910 | + Map data = new HashMap(); | |
| 7911 | + | |
| 7912 | + PersonModel personModel = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(cardNo).and("type").ne(2)), PersonModel.class); | |
| 7913 | + if (personModel != null) { | |
| 7914 | + String personModelId = personModel.getId(); | |
| 7915 | + List <MaternalDeliverModel> models = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModelId)). | |
| 7916 | + with(new Sort(Sort.Direction.DESC, "created")), MaternalDeliverModel.class); | |
| 7917 | + if (CollectionUtils.isNotEmpty(models)) { | |
| 7918 | + MaternalDeliverModel deliverModel = models.get(0); | |
| 7919 | + String parentId = deliverModel.getParentId(); | |
| 7920 | + Patients patientsModel = mongoTemplate.findOne(Query.query(Criteria.where("id").is(parentId)), Patients.class); | |
| 7921 | + if (patientsModel != null) { | |
| 7922 | + //data.put("blNo", blNo);//住院号 | |
| 7923 | + data.put("mommyName", patientsModel.getUsername()); | |
| 7924 | + data.put("phone", patientsModel.getPhone()); | |
| 7925 | + | |
| 7926 | + String dueWeek = ""; | |
| 7927 | + String week = (patientsModel.getFmWeek() / 7) + ""; | |
| 7928 | + int day = (patientsModel.getFmWeek() % 7); | |
| 7929 | + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 7930 | + Map <String, Object> handDueWeekMap = deliverModel.getHandDueWeek(); | |
| 7931 | + if (handDueWeekMap != null && handDueWeekMap.size() > 0 && handDueWeekMap.get("week") != null && com.lyms.platform.common.utils.StringUtils.isNotEmpty(String.valueOf(handDueWeekMap.get("week")))) { | |
| 7932 | + dueWeek = "孕" + String.valueOf(handDueWeekMap.get("week")) + "周" + ((handDueWeekMap.get("day") == null | |
| 7933 | + || String.valueOf(handDueWeekMap.get("day")).equals("0") || String.valueOf(handDueWeekMap.get("day")).equals("")) ? "" : "+" + String.valueOf(handDueWeekMap.get("day")) + "天"); | |
| 7934 | + } | |
| 7935 | + data.put("week", dueWeek); | |
| 7936 | + | |
| 7937 | + List <Map> babies = new ArrayList <>(); | |
| 7938 | + for (MaternalDeliverModel.Baby baby : deliverModel.getBaby()) { | |
| 7939 | + Map b = new HashMap(); | |
| 7940 | + | |
| 7941 | + b.put("dueTime", baby.getDueTime()); | |
| 7942 | + b.put("weight", baby.getBabyWeight()); | |
| 7943 | + b.put("hegint", baby.getBabyHeight()); | |
| 7944 | + b.put("sex", baby.getBabyGender()); | |
| 7945 | + babies.add(b); | |
| 7946 | + } | |
| 7947 | + | |
| 7948 | + data.put("babies", babies); | |
| 7949 | + | |
| 7950 | + data.put("cardNo", patientsModel.getCardNo()); | |
| 7951 | + | |
| 7952 | + String live = ""; //居住性质 对应户籍 | |
| 7953 | + if (StringUtils.isNotEmpty(patientsModel.getPcensusTypeId())) { | |
| 7954 | + live = patientsModel.getPcensusTypeId(); | |
| 7955 | + } | |
| 7956 | + | |
| 7957 | + String registered = ""; //户口性质 对应居住类别 | |
| 7958 | + if (StringUtils.isNotEmpty(patientsModel.getPliveTypeId())) { | |
| 7959 | + registered = patientsModel.getPliveTypeId(); | |
| 7960 | + } | |
| 7961 | + | |
| 7962 | + data.put("registered", registered); | |
| 7963 | + data.put("live", live); | |
| 7964 | + } | |
| 7965 | + } else { | |
| 7966 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("孕产婴系统没有找到对应的产妇分娩信息"); | |
| 7967 | + } | |
| 7968 | + } else { | |
| 7969 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("孕产婴系统没有找到对应的产妇"); | |
| 7970 | + } | |
| 7971 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(data); | |
| 7972 | + } | |
| 7905 | 7973 | |
| 7906 | 7974 | public BaseObjectResponse findDtAntExChuData(String id) { |
| 7907 | 7975 |