Commit d1f222d4455cf712112ac759bb53d444dafaafe1
1 parent
3bd5759a4b
Exists in
master
and in
6 other branches
秦皇岛妇幼报表导出-分娩管理-科研导出
Showing 3 changed files with 448 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
View file @
d1f222d
| ... | ... | @@ -733,5 +733,22 @@ |
| 733 | 733 | return matDeliverFacade.getLhWyFmManage(startTime,endTime, loginState.getId()); |
| 734 | 734 | } |
| 735 | 735 | |
| 736 | + /** | |
| 737 | + * 科研导出 | |
| 738 | + * | |
| 739 | + * @param httpServletRequest | |
| 740 | + * @param childbirthManagerRequest | |
| 741 | + * @param httpServletResponse | |
| 742 | + */ | |
| 743 | + @TokenRequired | |
| 744 | + @RequestMapping(value = "childbirthManagerExcel2", method = RequestMethod.POST) | |
| 745 | + public void childbirthManagerExcel2(HttpServletRequest httpServletRequest, @RequestBody ChildbirthManagerRequest childbirthManagerRequest, HttpServletResponse httpServletResponse) { | |
| 746 | + try { | |
| 747 | + childbirthManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); | |
| 748 | + matDeliverFacade.childbirthManagerExcel2(childbirthManagerRequest, httpServletResponse); | |
| 749 | + } catch (Exception e) { | |
| 750 | + ExceptionUtils.catchException(e, "childbirthManagerExcel2异常"); | |
| 751 | + } | |
| 752 | + } | |
| 736 | 753 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
d1f222d
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.hospitalapi.pojo.WhfyHisModel; |
| 7 | 7 | import com.lyms.hospitalapi.whfy.WhfyHisService; |
| 8 | 8 | import com.lyms.platform.biz.service.*; |
| 9 | +import com.lyms.platform.common.base.LoginContext; | |
| 9 | 10 | import com.lyms.platform.common.base.PageInfo; |
| 10 | 11 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 11 | 12 | import com.lyms.platform.common.enums.*; |
| ... | ... | @@ -3857,6 +3858,110 @@ |
| 3857 | 3858 | objectResponse.setErrormsg("成功"); |
| 3858 | 3859 | objectResponse.setData(list); |
| 3859 | 3860 | return objectResponse; |
| 3861 | + } | |
| 3862 | + | |
| 3863 | + public void childbirthManagerExcel2(ChildbirthManagerRequest childbirthManagerRequest, HttpServletResponse httpServletResponse)throws Exception { | |
| 3864 | + try { | |
| 3865 | + Map<String, String> query = childbirthManagerRequest.getInitQueryMapqhdky(); | |
| 3866 | + String queryStr = ""; | |
| 3867 | + for (String key : query.keySet()) { | |
| 3868 | + queryStr += key + ","; | |
| 3869 | + } | |
| 3870 | + childbirthManagerRequest.setInitQuery(queryStr.substring(0, queryStr.length() - 1)); | |
| 3871 | + childbirthManagerRequest.setExcel(true); | |
| 3872 | + childbirthManagerRequest.setLimit(10000);//导出数量 | |
| 3873 | + @SuppressWarnings("unchecked") | |
| 3874 | + List<Map<String, Object>> initQueryMapqhdkyList = childbirthManager2(childbirthManagerRequest).getData(); | |
| 3875 | + Map<String, String> header = childbirthManagerRequest.getInitQueryMapqhdky(); | |
| 3876 | + | |
| 3877 | + httpServletResponse.setContentType("application/force-download"); | |
| 3878 | + httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("科研导出.xls").getBytes("UTF-8"), "ISO-8859-1")); | |
| 3879 | + ExcelUtil.toExcel(httpServletResponse.getOutputStream(), initQueryMapqhdkyList, header); | |
| 3880 | + } catch (Exception e) { | |
| 3881 | + ExceptionUtils.catchException(e, "childbirthManagerExcel异常"); | |
| 3882 | + } | |
| 3883 | + } | |
| 3884 | + | |
| 3885 | + public ChildbirthManagerResult childbirthManager2(ChildbirthManagerRequest childbirthManagerRequest) { | |
| 3886 | + ChildbirthManagerResult childbirthManagerResult = new ChildbirthManagerResult(); | |
| 3887 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 3888 | + if (StringUtils.isNotEmpty(childbirthManagerRequest.getBirthDate())) { | |
| 3889 | + try { | |
| 3890 | + patientsQuery.setFmDateStart(DateUtil.getSNDate(childbirthManagerRequest.getBirthDate())[0]); | |
| 3891 | + patientsQuery.setFmDateEnd(DateUtil.getSNDate(childbirthManagerRequest.getBirthDate())[1]); | |
| 3892 | + } catch (Exception e) { | |
| 3893 | + // 什么都不做,这里是数据传入错误了 | |
| 3894 | + } | |
| 3895 | + } | |
| 3896 | + String hid = autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId()); | |
| 3897 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 3898 | + patientsQuery.setIsAutoFm(YnEnums.NO.getId()); | |
| 3899 | + patientsQuery.setType(3); | |
| 3900 | + // 构造医院id集合 | |
| 3901 | + List <String> hospitalList = new ArrayList <>(); | |
| 3902 | + hospitalList.add(hid); | |
| 3903 | + patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo()); | |
| 3904 | + patientsQuery.setFmHospitalList(hospitalList); | |
| 3905 | + patientsQuery.setDesc("fmDate"); | |
| 3906 | + patientsQuery.setSort("fmDate"); | |
| 3907 | + List <Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 3908 | + List <String> parentIdList = new ArrayList <>(); | |
| 3909 | + if (CollectionUtils.isEmpty(patientsList)) { | |
| 3910 | + // 没有查到,直接抛出 | |
| 3911 | + childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 3912 | + childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 3913 | + return childbirthManagerResult; | |
| 3914 | + } | |
| 3915 | + for (Patients patients : patientsList) { | |
| 3916 | + parentIdList.add(patients.getId()); | |
| 3917 | + } | |
| 3918 | + | |
| 3919 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 3920 | + matDeliverQuery.setLimit(childbirthManagerRequest.getLimit()); | |
| 3921 | + matDeliverQuery.setParentIdList(parentIdList); | |
| 3922 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 3923 | + matDeliverQuery.setHloseBloodType(childbirthManagerRequest.getHloseBloodType()); | |
| 3924 | + String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode(); | |
| 3925 | + matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); | |
| 3926 | + List <MaternalDeliverModel> maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); | |
| 3927 | + Map <String, Patients> patientsMap = new HashedMap(); | |
| 3928 | + | |
| 3929 | + for (Patients patients : patientsList) { | |
| 3930 | + patientsMap.put(patients.getId(), patients); | |
| 3931 | + } | |
| 3932 | + | |
| 3933 | + List<Map> date = new LinkedList<>(); | |
| 3934 | + int batchSize = 3; | |
| 3935 | + int end = 0; | |
| 3936 | + List <Future> futures = new ArrayList <>(); | |
| 3937 | + for (int i = 0; i < maternalDeliverModelList.size(); i += batchSize) { | |
| 3938 | + end = (end + batchSize); | |
| 3939 | + if (end > maternalDeliverModelList.size()) { | |
| 3940 | + end = maternalDeliverModelList.size(); | |
| 3941 | + } | |
| 3942 | + List <MaternalDeliverModel> mlist = maternalDeliverModelList.subList(i, end); | |
| 3943 | + Callable c = new MaterDeliverWorker2(recordService, babyService,antExService, | |
| 3944 | + mlist, patientsMap,mongoTemplate); | |
| 3945 | + Future f = commonThreadPool.submit(c); | |
| 3946 | + if (f != null) { | |
| 3947 | + futures.add(f); | |
| 3948 | + } | |
| 3949 | + } | |
| 3950 | + | |
| 3951 | + if (CollectionUtils.isNotEmpty(futures)) { | |
| 3952 | + for (Future f : futures) { | |
| 3953 | + try { | |
| 3954 | + date.addAll((List <Map>) f.get()); | |
| 3955 | + } catch (Exception e) { | |
| 3956 | + ExceptionUtils.catchException(e, "fm list error."); | |
| 3957 | + } | |
| 3958 | + } | |
| 3959 | + } | |
| 3960 | + | |
| 3961 | + childbirthManagerResult.setData(date); | |
| 3962 | + childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 3963 | + childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 3964 | + return childbirthManagerResult; | |
| 3860 | 3965 | } |
| 3861 | 3966 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java
View file @
d1f222d
| 1 | +package com.lyms.platform.operate.web.worker; | |
| 2 | + | |
| 3 | +import com.alibaba.druid.sql.visitor.functions.Substring; | |
| 4 | +import com.alibaba.fastjson.JSON; | |
| 5 | +import com.lyms.platform.biz.service.*; | |
| 6 | +import com.lyms.platform.common.enums.*; | |
| 7 | +import com.lyms.platform.common.utils.*; | |
| 8 | +import com.lyms.platform.operate.web.request.MatDeliverAddRequest; | |
| 9 | +import com.lyms.platform.operate.web.result.ChildbirthManagerQueryModel; | |
| 10 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 11 | +import com.lyms.platform.operate.web.utils.UnitConstants; | |
| 12 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 13 | +import com.lyms.platform.permission.service.UsersService; | |
| 14 | +import com.lyms.platform.pojo.*; | |
| 15 | +import com.lyms.platform.query.*; | |
| 16 | +import org.apache.commons.collections.CollectionUtils; | |
| 17 | +import org.apache.commons.collections.MapUtils; | |
| 18 | +import org.springframework.data.domain.Sort; | |
| 19 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
| 20 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 21 | +import org.springframework.data.mongodb.core.query.Query; | |
| 22 | + | |
| 23 | +import java.text.SimpleDateFormat; | |
| 24 | +import java.util.*; | |
| 25 | +import java.util.concurrent.Callable; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * 秦皇岛分娩管理-科研导出 | |
| 29 | + * | |
| 30 | + */ | |
| 31 | +public class MaterDeliverWorker2 implements Callable<List<Map>> { | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + private AntExRecordService recordService; | |
| 36 | + private BabyService babyService; | |
| 37 | + private AntenatalExaminationService antExService; | |
| 38 | + private List<MaternalDeliverModel> maternalDeliverModelList; | |
| 39 | + private Map<String, Patients> patientsMap; | |
| 40 | + private MongoTemplate mongoTemplate; | |
| 41 | + | |
| 42 | + public MaterDeliverWorker2(AntExRecordService recordService, BabyService babyService, AntenatalExaminationService antExService, | |
| 43 | + List<MaternalDeliverModel> maternalDeliverModelList, Map<String, Patients> patientsMap, | |
| 44 | + MongoTemplate mongoTemplate) { | |
| 45 | + this.maternalDeliverModelList = maternalDeliverModelList; | |
| 46 | + this.patientsMap = patientsMap; | |
| 47 | + this.recordService=recordService; | |
| 48 | + this.babyService = babyService; | |
| 49 | + this.antExService = antExService; | |
| 50 | + this.mongoTemplate = mongoTemplate; | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public List<Map> call() { | |
| 55 | + List<Map> date = new LinkedList<>(); | |
| 56 | + try { | |
| 57 | + for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { | |
| 58 | + Map<String, String> initQueryMapqhdky = new LinkedHashMap<>(); | |
| 59 | + Patients patients = patientsMap.get(maternalDeliverModel.getParentId()); | |
| 60 | + if (patients == null) | |
| 61 | + { | |
| 62 | + continue; | |
| 63 | + } | |
| 64 | + initQueryMapqhdky.put("name", StringUtils.isNotEmpty(patients.getUsername())?patients.getUsername():""); | |
| 65 | + initQueryMapqhdky.put("birth", null!=patients.getBirth()?DateUtil.getyyyy_MM_dd(patients.getBirth()):""); | |
| 66 | + initQueryMapqhdky.put("lastMens", null!=patients.getLastMenses()?DateUtil.getyyyy_MM_dd(patients.getLastMenses()):""); | |
| 67 | + if(StringUtils.isNotEmpty(patients.getId())){ | |
| 68 | + Criteria criteria= Criteria.where("parentId").is(patients.getId()); | |
| 69 | + AntExChuModel exChuModel = mongoTemplate.findOne(Query.query(criteria), AntExChuModel.class); | |
| 70 | + if(null!=exChuModel){ | |
| 71 | + initQueryMapqhdky.put("cc", null!=exChuModel.getProdTime()?0<exChuModel.getProdTime()?"否":"是":""); | |
| 72 | + initQueryMapqhdky.put("jc", null!=exChuModel.getProdTime()?0<exChuModel.getProdTime()?"是":"否":""); | |
| 73 | + initQueryMapqhdky.put("dt", StringUtils.isNotEmpty(exChuModel.getTireNumber())?1==Integer.parseInt(exChuModel.getTireNumber())?"是":"否":""); | |
| 74 | + initQueryMapqhdky.put("dantai", StringUtils.isNotEmpty(exChuModel.getTireNumber())?1<Integer.parseInt(exChuModel.getTireNumber())?"是":"否":""); | |
| 75 | + if(StringUtils.isNotEmpty(exChuModel.getBp())){ | |
| 76 | + Map<String, String> map = JSON.parseObject(exChuModel.getBp(), HashMap.class); | |
| 77 | + initQueryMapqhdky.put("ssy", map.get("ssy")); | |
| 78 | + initQueryMapqhdky.put("szy", map.get("szy")); | |
| 79 | + }else { | |
| 80 | + initQueryMapqhdky.put("ssy", ""); | |
| 81 | + initQueryMapqhdky.put("szy", ""); | |
| 82 | + } | |
| 83 | + initQueryMapqhdky.put("heigh", StringUtils.isNotEmpty(exChuModel.getHeight())?exChuModel.getHeight():""); | |
| 84 | + initQueryMapqhdky.put("beforeWeight", StringUtils.isNotEmpty(exChuModel.getYqWeight())?exChuModel.getYqWeight():""); | |
| 85 | + }else { | |
| 86 | + initQueryMapqhdky.put("cc", ""); | |
| 87 | + initQueryMapqhdky.put("jc", ""); | |
| 88 | + initQueryMapqhdky.put("dt", ""); | |
| 89 | + initQueryMapqhdky.put("dantai",""); | |
| 90 | + initQueryMapqhdky.put("ssy", ""); | |
| 91 | + initQueryMapqhdky.put("szy", ""); | |
| 92 | + initQueryMapqhdky.put("heigh", ""); | |
| 93 | + initQueryMapqhdky.put("beforeWeight",""); | |
| 94 | + } | |
| 95 | + | |
| 96 | + //体重2kg(24-28周) | |
| 97 | + AntExRecordQuery antExRecordQuery=new AntExRecordQuery(); | |
| 98 | + antExRecordQuery.setParentId(patients.getId()); | |
| 99 | + antExRecordQuery.setcDueWeekStart(168); | |
| 100 | + antExRecordQuery.setcDueWeekEnd(196); | |
| 101 | + List<AntExRecordModel> antExRecordModels = recordService.queryAntExRecords(antExRecordQuery); | |
| 102 | + if(CollectionUtils.isNotEmpty(antExRecordModels)){ | |
| 103 | + AntExRecordModel antExRecordModel= antExRecordModels.get(0); | |
| 104 | + if(null!=antExRecordModel){ | |
| 105 | + if(2==antExRecordModel.getType()){ //初诊 | |
| 106 | + Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
| 107 | + AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteriaf), AntExChuModel.class); | |
| 108 | + initQueryMapqhdky.put("mweight", null!=AntExChu.getWeight()?AntExChu.getWeight().toString():""); | |
| 109 | + }else { //复诊 | |
| 110 | + Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
| 111 | + AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); | |
| 112 | + initQueryMapqhdky.put("mweight", null!=AntExFu.getWeight()?AntExFu.getWeight().toString():""); | |
| 113 | + } | |
| 114 | + }else { | |
| 115 | + initQueryMapqhdky.put("mweight",""); | |
| 116 | + } | |
| 117 | + }else { | |
| 118 | + initQueryMapqhdky.put("mweight", ""); | |
| 119 | + } | |
| 120 | + //体重3kg(最后一次检查) | |
| 121 | + AntExRecordQuery antExRecordQuery2=new AntExRecordQuery(); | |
| 122 | + antExRecordQuery2.setParentId(patients.getId()); | |
| 123 | + List<AntExRecordModel> antExRecordModels2 = recordService.queryAntExRecords(antExRecordQuery2); | |
| 124 | + if(CollectionUtils.isNotEmpty(antExRecordModels2)){ | |
| 125 | + AntExRecordModel antExRecordModel= antExRecordModels2.get(0); | |
| 126 | + if(null!=antExRecordModel){ | |
| 127 | + if(2==antExRecordModel.getType()){ //初诊 | |
| 128 | + Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
| 129 | + AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteriaf), AntExChuModel.class); | |
| 130 | + initQueryMapqhdky.put("cweight", null!=AntExChu.getWeight()?AntExChu.getWeight().toString():""); | |
| 131 | + }else { //复诊 | |
| 132 | + Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
| 133 | + AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); | |
| 134 | + initQueryMapqhdky.put("cweight", null!=AntExFu.getWeight()?AntExFu.getWeight().toString():""); | |
| 135 | + } | |
| 136 | + }else { | |
| 137 | + initQueryMapqhdky.put("cweight", ""); | |
| 138 | + } | |
| 139 | + }else { | |
| 140 | + initQueryMapqhdky.put("cweight", ""); | |
| 141 | + } | |
| 142 | + if(null!=exChuModel){ | |
| 143 | + initQueryMapqhdky.put("jw", StringUtils.isNotEmpty(exChuModel.getJw())?exChuModel.getJw():""); | |
| 144 | + initQueryMapqhdky.put("yw", StringUtils.isNotEmpty(exChuModel.getYw())?exChuModel.getYw():""); | |
| 145 | + if(StringUtils.isNotEmpty(exChuModel.getFamilyHistory())){ | |
| 146 | + Map<String, String> map = JSON.parseObject(exChuModel.getFamilyHistory(), HashMap.class); | |
| 147 | + if(MapUtils.isNotEmpty(map)){ | |
| 148 | + if("no".equals(map.get("yesOrNo"))){ | |
| 149 | + initQueryMapqhdky.put("fpfq", ""); | |
| 150 | + initQueryMapqhdky.put("tnbfq", ""); | |
| 151 | + initQueryMapqhdky.put("gxyfq", ""); | |
| 152 | + initQueryMapqhdky.put("fpmq", ""); | |
| 153 | + initQueryMapqhdky.put("tnbmq", ""); | |
| 154 | + initQueryMapqhdky.put("gxymq", ""); | |
| 155 | + }else { | |
| 156 | + initQueryMapqhdky.put("fpfq", StringUtils.isNotEmpty(map.get("fpfq"))?"true".equals(map.get("fpfq"))?"是":"否":""); | |
| 157 | + initQueryMapqhdky.put("tnbfq", StringUtils.isNotEmpty(map.get("tnbfq"))?"true".equals(map.get("tnbfq"))?"是":"否":""); | |
| 158 | + initQueryMapqhdky.put("gxyfq", StringUtils.isNotEmpty(map.get("gxyfq"))?"true".equals(map.get("gxyfq"))?"是":"否":""); | |
| 159 | + initQueryMapqhdky.put("fpmq", StringUtils.isNotEmpty(map.get("fpmq"))?"true".equals(map.get("fpmq"))?"是":"否":""); | |
| 160 | + initQueryMapqhdky.put("tnbmq", StringUtils.isNotEmpty(map.get("tnbmq"))?"true".equals(map.get("tnbmq"))?"是":"否":""); | |
| 161 | + initQueryMapqhdky.put("gxymq", StringUtils.isNotEmpty(map.get("gxymq"))?"true".equals(map.get("gxymq"))?"是":"否":""); | |
| 162 | + } | |
| 163 | + }else { | |
| 164 | + initQueryMapqhdky.put("fpfq", ""); | |
| 165 | + initQueryMapqhdky.put("tnbfq", ""); | |
| 166 | + initQueryMapqhdky.put("gxyfq", ""); | |
| 167 | + initQueryMapqhdky.put("fpmq", ""); | |
| 168 | + initQueryMapqhdky.put("tnbmq", ""); | |
| 169 | + initQueryMapqhdky.put("gxymq", ""); | |
| 170 | + } | |
| 171 | + }else{ | |
| 172 | + initQueryMapqhdky.put("fpfq", ""); | |
| 173 | + initQueryMapqhdky.put("tnbfq", ""); | |
| 174 | + initQueryMapqhdky.put("gxyfq", ""); | |
| 175 | + initQueryMapqhdky.put("fpmq", ""); | |
| 176 | + initQueryMapqhdky.put("tnbmq", ""); | |
| 177 | + initQueryMapqhdky.put("gxymq", ""); | |
| 178 | + } | |
| 179 | + initQueryMapqhdky.put("tricer", StringUtils.isNotEmpty(exChuModel.getTricer())?exChuModel.getTricer():""); | |
| 180 | + initQueryMapqhdky.put("totalChol", StringUtils.isNotEmpty(exChuModel.getTotalChol())?exChuModel.getTotalChol():""); | |
| 181 | + initQueryMapqhdky.put("highDens", StringUtils.isNotEmpty(exChuModel.getHighDens())?exChuModel.getHighDens():""); | |
| 182 | + initQueryMapqhdky.put("lowDens",StringUtils.isNotEmpty(exChuModel.getLowDens())?exChuModel.getLowDens():""); | |
| 183 | + initQueryMapqhdky.put("bun", StringUtils.isNotEmpty(exChuModel.getBun())?exChuModel.getBun():""); | |
| 184 | + initQueryMapqhdky.put("cr", StringUtils.isNotEmpty(exChuModel.getCr())?exChuModel.getCr():""); | |
| 185 | + initQueryMapqhdky.put("ua", StringUtils.isNotEmpty(exChuModel.getUa())?exChuModel.getUa():""); | |
| 186 | + initQueryMapqhdky.put("rgaxa", StringUtils.isNotEmpty(exChuModel.getRgaxa())?exChuModel.getRgaxa():""); | |
| 187 | + initQueryMapqhdky.put("xqgczam", StringUtils.isNotEmpty(exChuModel.getXqgczam())?exChuModel.getXqgczam():""); | |
| 188 | + initQueryMapqhdky.put("xqgbzam", StringUtils.isNotEmpty(exChuModel.getXqgbzam())?exChuModel.getXqgbzam():""); | |
| 189 | + }else { | |
| 190 | + initQueryMapqhdky.put("jw", ""); | |
| 191 | + initQueryMapqhdky.put("yw", ""); | |
| 192 | + initQueryMapqhdky.put("fpfq", ""); | |
| 193 | + initQueryMapqhdky.put("tnbfq", ""); | |
| 194 | + initQueryMapqhdky.put("gxyfq", ""); | |
| 195 | + initQueryMapqhdky.put("fpmq", ""); | |
| 196 | + initQueryMapqhdky.put("tnbmq", ""); | |
| 197 | + initQueryMapqhdky.put("gxymq", ""); | |
| 198 | + initQueryMapqhdky.put("tricer", ""); | |
| 199 | + initQueryMapqhdky.put("totalChol",""); | |
| 200 | + initQueryMapqhdky.put("highDens",""); | |
| 201 | + initQueryMapqhdky.put("lowDens",""); | |
| 202 | + initQueryMapqhdky.put("bun",""); | |
| 203 | + initQueryMapqhdky.put("cr", ""); | |
| 204 | + initQueryMapqhdky.put("ua", ""); | |
| 205 | + initQueryMapqhdky.put("rgaxa", ""); | |
| 206 | + initQueryMapqhdky.put("xqgczam", ""); | |
| 207 | + initQueryMapqhdky.put("xqgbzam", ""); | |
| 208 | + } | |
| 209 | + //葡萄糖(空腹),葡萄糖(1h),葡萄糖(2h)复诊第一次:孕周24周-28周 | |
| 210 | + AntExRecordQuery antExRecordQuery3=new AntExRecordQuery(); | |
| 211 | + antExRecordQuery3.setParentId(patients.getId()); | |
| 212 | + antExRecordQuery3.setcDueWeekStart(168); | |
| 213 | + antExRecordQuery3.setcDueWeekEnd(196); | |
| 214 | + antExRecordQuery3.setType(1);//复诊 | |
| 215 | + List<AntExRecordModel> antExRecordModels3 = recordService.queryAntExRecords(antExRecordQuery3, Sort.Direction.ASC,"checkTime"); | |
| 216 | + if(CollectionUtils.isNotEmpty(antExRecordModels3)) { | |
| 217 | + AntExRecordModel antExRecordModel = antExRecordModels3.get(0); | |
| 218 | + Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
| 219 | + AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); | |
| 220 | + if(null!=AntExFu){ | |
| 221 | + initQueryMapqhdky.put("bloodSugarKf", StringUtils.isNotEmpty(AntExFu.getBloodSugarKf())?AntExFu.getBloodSugarKf():""); | |
| 222 | + initQueryMapqhdky.put("bloodSugar1h", StringUtils.isNotEmpty(AntExFu.getBloodSugar1h())?AntExFu.getBloodSugar1h():""); | |
| 223 | + initQueryMapqhdky.put("bloodSugar2h", StringUtils.isNotEmpty(AntExFu.getBloodSugar2h())?AntExFu.getBloodSugar2h():""); | |
| 224 | + }else { | |
| 225 | + initQueryMapqhdky.put("bloodSugarKf", ""); | |
| 226 | + initQueryMapqhdky.put("bloodSugar1h", ""); | |
| 227 | + initQueryMapqhdky.put("bloodSugar2h", ""); | |
| 228 | + } | |
| 229 | + | |
| 230 | + }else { | |
| 231 | + initQueryMapqhdky.put("bloodSugarKf", ""); | |
| 232 | + initQueryMapqhdky.put("bloodSugar1h", ""); | |
| 233 | + initQueryMapqhdky.put("bloodSugar2h", ""); | |
| 234 | + } | |
| 235 | + if(null!=exChuModel){ | |
| 236 | + initQueryMapqhdky.put("tf3", StringUtils.isNotEmpty(exChuModel.getTf3())?exChuModel.getTf3():""); | |
| 237 | + initQueryMapqhdky.put("tf4", StringUtils.isNotEmpty(exChuModel.getTf4())?exChuModel.getTf4():""); | |
| 238 | + initQueryMapqhdky.put("ctsh", StringUtils.isNotEmpty(exChuModel.getCtsh())?exChuModel.getCtsh():""); | |
| 239 | + initQueryMapqhdky.put("ctgab", StringUtils.isNotEmpty(exChuModel.getCtgab())?exChuModel.getCtgab():""); | |
| 240 | + initQueryMapqhdky.put("ctpoab", StringUtils.isNotEmpty(exChuModel.getCtpoab())?exChuModel.getCtpoab():""); | |
| 241 | + }else { | |
| 242 | + initQueryMapqhdky.put("tf3", ""); | |
| 243 | + initQueryMapqhdky.put("tf4", ""); | |
| 244 | + initQueryMapqhdky.put("ctsh", ""); | |
| 245 | + initQueryMapqhdky.put("ctgab", ""); | |
| 246 | + initQueryMapqhdky.put("ctpoab", ""); | |
| 247 | + } | |
| 248 | + //分娩记录 | |
| 249 | + Criteria criteriaFm= Criteria.where("parentId").is(patients.getId()); | |
| 250 | + MaternalDeliverModel deliverModel = mongoTemplate.findOne(Query.query(criteriaFm), MaternalDeliverModel.class); | |
| 251 | + if(CollectionUtils.isNotEmpty(deliverModel.getBaby())){ | |
| 252 | + String weight=""; | |
| 253 | + String apgarScore = ""; | |
| 254 | + for (MaternalDeliverModel.Baby baby : deliverModel.getBaby()) { | |
| 255 | + if(StringUtils.isNotEmpty(baby.getBabyWeight())){ | |
| 256 | + weight+=baby.getBabyWeight()+"/"; | |
| 257 | + } | |
| 258 | + if(StringUtils.isNotEmpty(baby.getApgarScore())){ | |
| 259 | + Map<String, String> map = JsonUtil.getMap(baby.getApgarScore()); | |
| 260 | + if (MapUtils.isNotEmpty(map)) { | |
| 261 | + String apgarScorePf1 = StringUtils.isNotEmpty(map.get("pf1"))? map.get("pf1") : ""; | |
| 262 | + String apgarScorePf5 = StringUtils.isNotEmpty(map.get("pf1"))? map.get("pf1") : ""; | |
| 263 | + String apgarScorePf10 = StringUtils.isNotEmpty(map.get("pf1"))? map.get("pf1") : ""; | |
| 264 | + apgarScore += apgarScorePf1 + UnitConstants.FEN + " - " + apgarScorePf5 + UnitConstants.FEN + " - " + apgarScorePf10 + UnitConstants.FEN+"/"; | |
| 265 | + } | |
| 266 | + } | |
| 267 | + } | |
| 268 | + initQueryMapqhdky.put("babyWeight", StringUtils.isNotEmpty(weight)?weight.substring(0,weight.length()-1):weight); | |
| 269 | + initQueryMapqhdky.put("", ""); | |
| 270 | + initQueryMapqhdky.put("apgarScore", StringUtils.isNotEmpty(apgarScore)?apgarScore.substring(0,apgarScore.length()-1):apgarScore); | |
| 271 | + }else { | |
| 272 | + initQueryMapqhdky.put("babyWeight", ""); | |
| 273 | + initQueryMapqhdky.put("", ""); | |
| 274 | + initQueryMapqhdky.put("apgarScore", ""); | |
| 275 | + } | |
| 276 | + | |
| 277 | + }else { | |
| 278 | + initQueryMapqhdky.put("cc", ""); | |
| 279 | + initQueryMapqhdky.put("jc", ""); | |
| 280 | + initQueryMapqhdky.put("dt", ""); | |
| 281 | + initQueryMapqhdky.put("dantai", ""); | |
| 282 | + initQueryMapqhdky.put("ssy", ""); | |
| 283 | + initQueryMapqhdky.put("szy", ""); | |
| 284 | + initQueryMapqhdky.put("heigh", ""); | |
| 285 | + initQueryMapqhdky.put("beforeWeight", ""); | |
| 286 | + initQueryMapqhdky.put("mweight", ""); | |
| 287 | + initQueryMapqhdky.put("cweight", ""); | |
| 288 | + initQueryMapqhdky.put("jw", ""); | |
| 289 | + initQueryMapqhdky.put("yw", ""); | |
| 290 | + initQueryMapqhdky.put("fpfq", ""); | |
| 291 | + initQueryMapqhdky.put("tnbfq", ""); | |
| 292 | + initQueryMapqhdky.put("gxyfq", ""); | |
| 293 | + initQueryMapqhdky.put("fpmq", ""); | |
| 294 | + initQueryMapqhdky.put("tnbmq", ""); | |
| 295 | + initQueryMapqhdky.put("gxymq", ""); | |
| 296 | + initQueryMapqhdky.put("tricer", ""); | |
| 297 | + initQueryMapqhdky.put("totalChol", ""); | |
| 298 | + initQueryMapqhdky.put("highDens", ""); | |
| 299 | + initQueryMapqhdky.put("lowDens", ""); | |
| 300 | + initQueryMapqhdky.put("bun", ""); | |
| 301 | + initQueryMapqhdky.put("cr", ""); | |
| 302 | + initQueryMapqhdky.put("ua", ""); | |
| 303 | + initQueryMapqhdky.put("rgaxa", ""); | |
| 304 | + initQueryMapqhdky.put("xqgczam", ""); | |
| 305 | + initQueryMapqhdky.put("xqgbzam", ""); | |
| 306 | + initQueryMapqhdky.put("bloodSugarKf", ""); | |
| 307 | + initQueryMapqhdky.put("bloodSugar1h", ""); | |
| 308 | + initQueryMapqhdky.put("bloodSugar2h", ""); | |
| 309 | + initQueryMapqhdky.put("tf3", ""); | |
| 310 | + initQueryMapqhdky.put("tf4", ""); | |
| 311 | + initQueryMapqhdky.put("ctsh", ""); | |
| 312 | + initQueryMapqhdky.put("ctgab", ""); | |
| 313 | + initQueryMapqhdky.put("ctpoab", ""); | |
| 314 | + initQueryMapqhdky.put("babyWeight", ""); | |
| 315 | + initQueryMapqhdky.put("", ""); | |
| 316 | + initQueryMapqhdky.put("apgarScore", ""); | |
| 317 | + } | |
| 318 | + date.add(initQueryMapqhdky); | |
| 319 | + } | |
| 320 | + }catch (Exception e) { | |
| 321 | + e.printStackTrace(); | |
| 322 | + } | |
| 323 | + return date; | |
| 324 | + } | |
| 325 | + | |
| 326 | +} |