Commit 3988aa2a8dabb1e3939098b79ef0837e38af7fe0
1 parent
0ca593cad2
Exists in
master
and in
6 other branches
update
Showing 5 changed files with 156 additions and 1 deletions
- platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/QhdZyBaseInfo.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
- 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/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/DefectiveChildServiceImpl.java
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/QhdZyBaseInfo.java
View file @
3988aa2
| 1 | +package com.lyms.hospitalapi.pojo; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Created by Administrator on 2020-01-03. | |
| 5 | + */ | |
| 6 | +public class QhdZyBaseInfo { | |
| 7 | + | |
| 8 | + private String cardNo; | |
| 9 | + | |
| 10 | + public String getCardNo() { | |
| 11 | + return cardNo; | |
| 12 | + } | |
| 13 | + | |
| 14 | + public void setCardNo(String cardNo) { | |
| 15 | + this.cardNo = cardNo; | |
| 16 | + } | |
| 17 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
View file @
3988aa2
| ... | ... | @@ -1007,5 +1007,34 @@ |
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | |
| 1010 | + /** | |
| 1011 | + * | |
| 1012 | + * 根据病历号(住院号)查询对应人的身份证号码 | |
| 1013 | + * @param blNo | |
| 1014 | + * @return | |
| 1015 | + */ | |
| 1016 | + public String queryPatientCardNoByBlNo(String blNo) { | |
| 1017 | + | |
| 1018 | + Connection conn = null; | |
| 1019 | + String sql = "select blh,syxh,hzxm,birth,birthtime,sex from VW_LYMS_XSE_BRSYK where "; | |
| 1020 | + try { | |
| 1021 | + | |
| 1022 | + conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeHisConnection(); | |
| 1023 | + QueryRunner queryRunner = new QueryRunner(); | |
| 1024 | + | |
| 1025 | + List<QhdZyBaseInfo> list = queryRunner.query(conn, sql, new BeanListHandler<QhdZyBaseInfo>(QhdZyBaseInfo.class)); | |
| 1026 | + if (CollectionUtils.isNotEmpty(list)) | |
| 1027 | + { | |
| 1028 | + QhdZyBaseInfo info = list.get(0); | |
| 1029 | + return (info != null && StringUtils.isNotEmpty(info.getCardNo())) ? info.getCardNo().trim() : ""; | |
| 1030 | + } | |
| 1031 | + } catch (Exception e) { | |
| 1032 | + ExceptionUtils.catchException(e, "queryPatientCardNoByBlNo error. sql:" + sql); | |
| 1033 | + } finally { | |
| 1034 | + DbUtils.closeQuietly(conn); | |
| 1035 | + } | |
| 1036 | + return ""; | |
| 1037 | + } | |
| 1038 | + | |
| 1010 | 1039 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
3988aa2
| ... | ... | @@ -988,5 +988,26 @@ |
| 988 | 988 | return viewFacade.getCheckList(id); |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | + | |
| 992 | + /** | |
| 993 | + * 因秦皇岛市妇幼保健院新筛(串联质谱)业务需要,现需要与第三方软件进行数据对接, | |
| 994 | + * 通过请求接口返回本院新生儿及家长的基本信息。 | |
| 995 | + * @param blNo | |
| 996 | + * @param Authorization | |
| 997 | + * @return | |
| 998 | + */ | |
| 999 | + @RequestMapping(value = "/getBabyScreeningInfo", method = RequestMethod.GET) | |
| 1000 | + @ResponseBody | |
| 1001 | + public BaseObjectResponse getBabyScreeningInfo(@RequestParam(required = true) String blNo, | |
| 1002 | + @RequestHeader(required = true) String Authorization) { | |
| 1003 | + | |
| 1004 | + if (StringUtils.isEmpty(Authorization) || !"1a8152fc04c86b9cca3244e0e52ecb33".equals(Authorization)) | |
| 1005 | + { | |
| 1006 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Authorization验证失败"); | |
| 1007 | + } | |
| 1008 | + | |
| 1009 | + return viewFacade.getBabyScreeningInfo(blNo); | |
| 1010 | + } | |
| 1011 | + | |
| 991 | 1012 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
3988aa2
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | import java.util.Map; |
| 18 | 18 | import java.util.Set; |
| 19 | 19 | |
| 20 | +import com.lyms.hospitalapi.qhdfy.QhdfyHisService; | |
| 20 | 21 | import org.apache.commons.collections.CollectionUtils; |
| 21 | 22 | import org.apache.commons.collections.MapUtils; |
| 22 | 23 | import org.apache.commons.collections.map.HashedMap; |
| ... | ... | @@ -231,6 +232,12 @@ |
| 231 | 232 | @Autowired |
| 232 | 233 | private BabyEvaluationCriterionService babyEvaluationCriterionService; |
| 233 | 234 | |
| 235 | + | |
| 236 | + | |
| 237 | + @Autowired | |
| 238 | + private QhdfyHisService qhdfyHisService; | |
| 239 | + | |
| 240 | + | |
| 234 | 241 | /** |
| 235 | 242 | * 建档查询 |
| 236 | 243 | * |
| ... | ... | @@ -6659,5 +6666,84 @@ |
| 6659 | 6666 | } |
| 6660 | 6667 | |
| 6661 | 6668 | |
| 6669 | + public BaseObjectResponse getBabyScreeningInfo(String blNo) { | |
| 6670 | + | |
| 6671 | + //String cardNo = qhdfyHisService.queryPatientCardNoByBlNo(blNo); | |
| 6672 | + String cardNo = blNo; | |
| 6673 | + System.out.println("query qhd cardno " + cardNo); | |
| 6674 | + if (StringUtils.isEmpty(cardNo)) | |
| 6675 | + { | |
| 6676 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("住院信息中没有身份证信息"); | |
| 6677 | + } | |
| 6678 | + Map data = new HashMap(); | |
| 6679 | + | |
| 6680 | + PersonModel personModel = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(cardNo).and("type").ne(2)), PersonModel.class); | |
| 6681 | + if (personModel != null) { | |
| 6682 | + String personModelId = personModel.getId(); | |
| 6683 | + List<MaternalDeliverModel> models = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModelId)). | |
| 6684 | + with(new Sort(Sort.Direction.DESC, "created")), MaternalDeliverModel.class); | |
| 6685 | + if (CollectionUtils.isNotEmpty(models)) { | |
| 6686 | + MaternalDeliverModel deliverModel = models.get(0); | |
| 6687 | + String parentId = deliverModel.getParentId(); | |
| 6688 | + Patients patientsModel = mongoTemplate.findOne(Query.query(Criteria.where("id").is(parentId)), Patients.class); | |
| 6689 | + if (patientsModel != null) { | |
| 6690 | + data.put("blNo",blNo);//住院号 | |
| 6691 | + data.put("mommyName",patientsModel.getUsername()); | |
| 6692 | + data.put("phone",patientsModel.getPhone()); | |
| 6693 | + | |
| 6694 | + String dueWeek = ""; | |
| 6695 | + String week = (patientsModel.getFmWeek() / 7) + ""; | |
| 6696 | + int day = (patientsModel.getFmWeek() % 7); | |
| 6697 | + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 6698 | + Map<String, Object> handDueWeekMap = deliverModel.getHandDueWeek(); | |
| 6699 | + if (handDueWeekMap != null && handDueWeekMap.size() > 0 && handDueWeekMap.get("week") != null && com.lyms.platform.common.utils.StringUtils.isNotEmpty(String.valueOf(handDueWeekMap.get("week")))) | |
| 6700 | + { | |
| 6701 | + dueWeek = "孕"+String.valueOf(handDueWeekMap.get("week"))+"周"+((handDueWeekMap.get("day") == null | |
| 6702 | + || String.valueOf(handDueWeekMap.get("day")).equals("0") || String.valueOf(handDueWeekMap.get("day")).equals("")) ? "" : "+"+String.valueOf(handDueWeekMap.get("day"))+"天" ); | |
| 6703 | + } | |
| 6704 | + data.put("week",dueWeek); | |
| 6705 | + | |
| 6706 | + List<Map> babies = new ArrayList<>(); | |
| 6707 | + for (MaternalDeliverModel.Baby baby : deliverModel.getBaby()) | |
| 6708 | + { | |
| 6709 | + Map b = new HashMap(); | |
| 6710 | + | |
| 6711 | + Date dueTime = DateUtil.parseYMDHM(baby.getDueTime()); | |
| 6712 | + b.put("dueTime",dueTime); | |
| 6713 | + b.put("weight",baby.getBabyWeight()); | |
| 6714 | + b.put("hegint",baby.getBabyHeight()); | |
| 6715 | + b.put("sex",SexEnum.getTextById( | |
| 6716 | + Integer.parseInt(baby.getBabyGender()))); | |
| 6717 | + babies.add(b); | |
| 6718 | + } | |
| 6719 | + | |
| 6720 | + data.put("babies",babies); | |
| 6721 | + | |
| 6722 | + data.put("cardNo",patientsModel.getCardNo()); | |
| 6723 | + String registered = ""; //居住性质 | |
| 6724 | + if(StringUtils.isNotEmpty(patientsModel.getPcensusTypeId())){ | |
| 6725 | + patientsModel.getPcensusTypeId(); | |
| 6726 | + } | |
| 6727 | + | |
| 6728 | + String live = ""; //户口性质 | |
| 6729 | + if(StringUtils.isNotEmpty(patientsModel.getPliveTypeId())){ | |
| 6730 | + live = patientsModel.getPliveTypeId(); | |
| 6731 | + } | |
| 6732 | + | |
| 6733 | + data.put("registered",registered); | |
| 6734 | + data.put("live",live); | |
| 6735 | + } | |
| 6736 | + } | |
| 6737 | + else | |
| 6738 | + { | |
| 6739 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("孕产婴系统没有找到对应的产妇分娩信息"); | |
| 6740 | + } | |
| 6741 | + } | |
| 6742 | + else | |
| 6743 | + { | |
| 6744 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("孕产婴系统没有找到对应的产妇"); | |
| 6745 | + } | |
| 6746 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 6747 | + } | |
| 6662 | 6748 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/DefectiveChildServiceImpl.java
View file @
3988aa2
| ... | ... | @@ -253,10 +253,12 @@ |
| 253 | 253 | */ |
| 254 | 254 | @Override |
| 255 | 255 | public BaseResponse getPatientInfoByIdCard(CommonParamRequest param,Integer userId) { |
| 256 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 256 | 257 | String inHospitalId = param.getCardNo(); |
| 257 | 258 | List<DefectiveChildModelResult> results = new LinkedList<>(); |
| 258 | 259 | if (StringUtils.isNotEmpty(inHospitalId)) { |
| 259 | - List<DefectiveChildModel> defectiveChildModels = mongoTemplate.find(Query.query(Criteria.where("inHospitalId").is(inHospitalId)), DefectiveChildModel.class); | |
| 260 | + List<DefectiveChildModel> defectiveChildModels = mongoTemplate.find(Query.query(Criteria.where("inHospitalId").is(inHospitalId). | |
| 261 | + and("hospitalId").is(hospitalId)), DefectiveChildModel.class); | |
| 260 | 262 | for (DefectiveChildModel model : defectiveChildModels) { |
| 261 | 263 | DefectiveChildModelResult result = getResultByModel(model); |
| 262 | 264 | results.add(result); |