From 947f00c70a4e0c9c2c75c9c85ee73316677f2377 Mon Sep 17 00:00:00 2001 From: gengxiaokai Date: Sat, 8 Sep 2018 11:58:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=A6=E7=9A=87=E5=B2=9B=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=85=AC=E5=8D=AB=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyms/hospitalapi/qhdfy/QhdJbgwInterface.java | 263 ++++++++++++++++++--- 1 file changed, 227 insertions(+), 36 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java index a2a52a7..43316a9 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java @@ -78,13 +78,72 @@ public class QhdJbgwInterface { if(list != null && list.size() > 0){ for(Patients patients : list){ try{ + //居住地址 + String jzSheng = CommonsHelper.getName1(patients.getProvinceRegisterId(), basicConfigService); + String jzShi = CommonsHelper.getName1(patients.getCityRegisterId(), basicConfigService); + String jzXian = CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService); + String jzXiang = CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService); + String jQquan = jzSheng+jzShi+jzXian+jzXiang; + + //户籍地址 + String hjSheng = CommonsHelper.getName1(patients.getProvinceId(), basicConfigService); + String hjShi = CommonsHelper.getName1(patients.getCityId(), basicConfigService); + String hjXian = CommonsHelper.getName1(patients.getAreaId(), basicConfigService); + String hjXiang = CommonsHelper.getName1(patients.getStreetId(), basicConfigService); + String hQuan = hjSheng+hjShi+hjXian+hjXiang; + AntExChuQuery antExChuQuery = new AntExChuQuery(); antExChuQuery.setParentId(patients.getId()); List aList = antExService.queryAntExChu(antExChuQuery); Map map = new HashMap(); if(aList != null && aList.size() > 0){ + if(aList.get(0).getAbortionZR() != null){ + map.put("SPONTANEOUSABORTIONCOUNT",aList.get(0).getAbortionZR().toString()); + } + if(aList.get(0).getAbortionRG() != null){ + map.put("ARTIFICIALABORTIONCOUNT",aList.get(0).getAbortionRG().toString()); + } + if(aList.get(0).getPregnancyTimes() != null){ + map.put("GRAVIDITY",aList.get(0).getPregnancyTimes().toString()); + } + if(aList.get(0).getProdTime() != null){ + map.put("PARITY",aList.get(0).getProdTime().toString()); + } + map.put("HEIGHT",aList.get(0).getHeight()); + map.put("WEIGHT",aList.get(0).getWeight()); + if(aList.get(0).getHeight() != null && aList.get(0).getWeight() != null){ + Double wh = Double.parseDouble(aList.get(0).getHeight()) / 100; + Double shen = wh * wh; + Double bmi = Double.parseDouble(aList.get(0).getWeight()) / shen; + map.put("BMI",bmi.toString()); + } + String ssy = ""; + String szy = ""; + Map chBpMap = JsonUtil.getMap(aList.get(0).getBp()); + if (MapUtils.isNotEmpty(chBpMap)) { + ssy = chBpMap.get("ssy"); + szy = chBpMap.get("szy"); + } + map.put("SBP",ssy); + map.put("DBP",szy); + map.put("REGISTERPASTHISTORY",aList.get(0).getPastHistory()); + map.put("REGISTERFAMILYHISTORY",aList.get(0).getFamilyHistory()); + map.put("GESTATIONSTATUS",aList.get(0).getCestationInfo()); + } + + if("农业户口".equals(getBasicConfig(patients.getPcensusTypeId()))){ + map.put("HOUSEHOLDTYPECODE", "1"); + }else if("非农业户口".equals(getBasicConfig(patients.getPcensusTypeId()))){ + map.put("HOUSEHOLDTYPECODE", "2"); } + if("本地".equals(getBasicConfig(patients.getPliveTypeId()))){ + map.put("RESIDENCETYPECODE","1"); + }else if("外地".equals(getBasicConfig(patients.getPliveTypeId()))){ + map.put("RESIDENCETYPECODE","2"); + } + map.put("OCCUPATIONCODE",patients.getPprofessionTypeId()); + map.put("MENSESPERIOD",patients.getMensStartDay()); map.put("MATERNALINFOID",patients.getId()); map.put("NAME",patients.getUsername()); if("70ae1d93-2964-46bc-83fa-bec9ff605b1c".equals(patients.getHcertificateTypeId())){ @@ -99,10 +158,8 @@ public class QhdJbgwInterface { map.put("HUSBANDAGE",DateUtil.getAge(patients.getHusbandBirth()).toString()); } map.put("HUSBANDUNIT",patients.getHworkUnit()); - map.put("ADDRESS",null); - map.put("HOUSEHOLDADDRESS", CommonsHelper.getResidence(patients.getHprovinceRegisterId(), patients.getHcityRegisterId(), - patients.getHareaRegisterId(), patients.getHstreetRegisterId(), patients.getHaddressRegister(), - basicConfigService)); + map.put("ADDRESS",jQquan); + map.put("HOUSEHOLDADDRESS",hQuan); map.put("HUSBANDTELNO",patients.getHusbandPhone()); map.put("MENSESLASTDATE",DateUtil.getyyyy_MM_dd(patients.getLastMenses())); map.put("EXPECTEDCHILDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getDueDate())); @@ -137,19 +194,86 @@ public class QhdJbgwInterface { * @return */ public List> getChuZhen(String startDate,String endDate){ + List list = null; List> mList = new ArrayList>(); - AntExChuQuery antExChuQuery = new AntExChuQuery(); - antExChuQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); - antExChuQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); - List list = antExService.queryAntExChu(antExChuQuery); + AntExChuQuery antExChuQuery1 = new AntExChuQuery(); + antExChuQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + antExChuQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + list = antExService.queryAntExChu(antExChuQuery1); + if(list == null || list.size() == 0){ + AntExChuQuery antExChuQuery = new AntExChuQuery(); + antExChuQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); + antExChuQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); + list = antExService.queryAntExChu(antExChuQuery); + } if(list != null && list.size() > 0){ for(AntExChuModel antExChuModel : list){ try{ Patients patients = patientsService.findOnePatientById(antExChuModel.getParentId()); + + //居住地址 + String jzSheng = CommonsHelper.getName1(patients.getProvinceRegisterId(), basicConfigService); + String jzShi = CommonsHelper.getName1(patients.getCityRegisterId(), basicConfigService); + String jzXian = CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService); + String jzXiang = CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService); + String jQquan = jzSheng+jzShi+jzXian+jzXiang; + + //户籍地址 + String hjSheng = CommonsHelper.getName1(patients.getProvinceId(), basicConfigService); + String hjShi = CommonsHelper.getName1(patients.getCityId(), basicConfigService); + String hjXian = CommonsHelper.getName1(patients.getAreaId(), basicConfigService); + String hjXiang = CommonsHelper.getName1(patients.getStreetId(), basicConfigService); + String hQuan = hjSheng+hjShi+hjXian+hjXiang; + String cDueWeek = ResolveUtils.getPregnancyWeek(patients.getLastMenses(), antExChuModel.getCheckTime()); int week = Integer.parseInt(cDueWeek.substring(1, cDueWeek.indexOf("周"))); int day = Integer.parseInt(cDueWeek.substring(cDueWeek.indexOf("+")+1, cDueWeek.indexOf("天"))); Map map = new HashMap(); + //增加孕产登记 + if("农业户口".equals(getBasicConfig(patients.getPcensusTypeId()))){ + map.put("HOUSEHOLDTYPECODE", "1"); + }else if("非农业户口".equals(getBasicConfig(patients.getPcensusTypeId()))){ + map.put("HOUSEHOLDTYPECODE", "2"); + } + if("本地".equals(getBasicConfig(patients.getPliveTypeId()))){ + map.put("RESIDENCETYPECODE","1"); + }else if("外地".equals(getBasicConfig(patients.getPliveTypeId()))){ + map.put("RESIDENCETYPECODE","2"); + } + map.put("OCCUPATIONCODE",patients.getPprofessionTypeId()); + map.put("MENSESPERIOD",patients.getMensStartDay()); + map.put("MATERNALINFOID",patients.getId()); + map.put("NAME",patients.getUsername()); + if("70ae1d93-2964-46bc-83fa-bec9ff605b1c".equals(patients.getHcertificateTypeId())){ + map.put("IDCARD",patients.getCardNo()); + } + map.put("TELNO",patients.getPhone()); + map.put("BIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getBirth())); + map.put("AGE",DateUtil.getAge(patients.getBirth()).toString()); + map.put("UNIT",patients.getPworkUnit()); + map.put("HUSBANDNAME",patients.getHusbandName()); + if(patients.getHusbandBirth() != null){ + map.put("HUSBANDAGE",DateUtil.getAge(patients.getHusbandBirth()).toString()); + } + map.put("HUSBANDUNIT",patients.getHworkUnit()); + map.put("ADDRESS",jQquan); + map.put("HOUSEHOLDADDRESS",hQuan); + map.put("HUSBANDTELNO",patients.getHusbandPhone()); + map.put("MENSESLASTDATE",DateUtil.getyyyy_MM_dd(patients.getLastMenses())); + map.put("EXPECTEDCHILDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getDueDate())); + String hospital = ""; + if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { + hospital = organization.getName(); + } + } + map.put("ORGNAME",hospital); + map.put("ORGCODE",patients.getHospitalId()); + map.put("BUILDINGMANUALDATE",DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); + map.put("NATIONALITYVALUE",getBasicConfig(patients.getPnationId())); + map.put("BUILDWEEKS", ResolveUtils.getPregnancyWeek(patients, patients.getBookbuildingDate())); + map.put("MATERNALFIRSTFOLLOWUPID",antExChuModel.getId()); map.put("MATERNALINFOID",patients.getId()); map.put("NAME",patients.getUsername()); @@ -319,14 +443,39 @@ public class QhdJbgwInterface { } map.put("WVDEXAM",ydfmw); map.put("ORGCODE",patients.getHospitalId()); - String hospital = ""; + /*String hospital = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); if (organization != null && organization.getYn() == YnEnums.YES.getId()) { hospital = organization.getName(); } } - map.put("ORGNAME",hospital); + map.put("ORGNAME",hospital);*/ + + + if(antExChuModel.getAbortionZR() != null){ + map.put("SPONTANEOUSABORTIONCOUNT",antExChuModel.getAbortionZR().toString()); + } + if(antExChuModel.getAbortionRG() != null){ + map.put("ARTIFICIALABORTIONCOUNT",antExChuModel.getAbortionRG().toString()); + } + if(antExChuModel.getPregnancyTimes() != null){ + map.put("GRAVIDITY",antExChuModel.getPregnancyTimes().toString()); + } + if(antExChuModel.getProdTime() != null){ + map.put("PARITY",antExChuModel.getProdTime().toString()); + } + map.put("HEIGHT",antExChuModel.getHeight()); + map.put("WEIGHT",antExChuModel.getWeight()); + if(antExChuModel.getHeight() != null && antExChuModel.getWeight() != null){ + Double wh = Double.parseDouble(antExChuModel.getHeight()) / 100; + Double shen = wh * wh; + Double bmi = Double.parseDouble(antExChuModel.getWeight()) / shen; + map.put("BMI",bmi.toString()); + } + map.put("REGISTERPASTHISTORY",antExChuModel.getPastHistory()); + map.put("REGISTERFAMILYHISTORY",antExChuModel.getFamilyHistory()); + map.put("GESTATIONSTATUS",antExChuModel.getCestationInfo()); mList.add(map); }catch (Exception e){ e.printStackTrace(); @@ -347,11 +496,18 @@ public class QhdJbgwInterface { * @return */ public List> getFuZhen(String startDate,String endDate){ + List list = null; List> mList = new ArrayList>(); - AntExQuery antExQuery = new AntExQuery(); - antExQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); - antExQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); - List list = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); + AntExQuery antExQuery1 = new AntExQuery(); + antExQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + antExQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + list = antExService.queryAntenatalExamination(antExQuery1.convertToQuery().addOrder(Sort.Direction.DESC, "created")); + if(null == list || list.size() == 0){ + AntExQuery antExQuery = new AntExQuery(); + antExQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); + antExQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); + list = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); + } if(list != null && list.size() > 0){ for(AntenatalExaminationModel data : list){ try{ @@ -422,11 +578,18 @@ public class QhdJbgwInterface { * @return */ public List> getFm(String startDate,String endDate){ + List list = null; List> mList = new ArrayList>(); - MatDeliverQuery deliverQuery = new MatDeliverQuery(); - deliverQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); - deliverQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); - List list = matDeliverService.query(deliverQuery); + MatDeliverQuery deliverQuery1 = new MatDeliverQuery(); + deliverQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + deliverQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + list = matDeliverService.query(deliverQuery1); + if(null == list || list.size() == 0){ + MatDeliverQuery deliverQuery = new MatDeliverQuery(); + deliverQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); + deliverQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); + list = matDeliverService.query(deliverQuery); + } if(list != null && list.size() > 0){ for(MaternalDeliverModel data : list) { Patients patients = patientsService.findOnePatientById(data.getParentId()); @@ -689,12 +852,19 @@ public class QhdJbgwInterface { * @return */ public List> getXse(String startDate,String endDate){ + List models = null; List> mList = new ArrayList>(); - BabyModelQuery babyQuery = new BabyModelQuery(); - babyQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); - babyQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); - babyQuery.setYn(YnEnums.YES.getId()); - List models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); + BabyModelQuery babyQuery1 = new BabyModelQuery(); + babyQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + babyQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + models = babyBookbuildingService.queryBabyBuildByCond(babyQuery1); + if(null == models || models.size() == 0){ + BabyModelQuery babyQuery = new BabyModelQuery(); + babyQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); + babyQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); + babyQuery.setYn(YnEnums.YES.getId()); + models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); + } if(models != null && models.size() > 0){ for(BabyModel babyModel : models){ try{ @@ -759,11 +929,18 @@ public class QhdJbgwInterface { * @return */ public List> getChfs(String startDate,String endDate){ + List list = null; List> mList = new ArrayList>(); - MatDeliverFollowQuery deliverQuery = new MatDeliverFollowQuery(); - deliverQuery.setUpdateDateStart(DateUtil.parseYMDHMS(startDate)); - deliverQuery.setUpdateDateEnd(DateUtil.parseYMDHMS(endDate)); - List list = matDeliverFollowService.query(deliverQuery); + MatDeliverFollowQuery deliverQuery1 = new MatDeliverFollowQuery(); + deliverQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + deliverQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + list = matDeliverFollowService.query(deliverQuery1); + if(null == list || list.size() == 0){ + MatDeliverFollowQuery deliverQuery = new MatDeliverFollowQuery(); + deliverQuery.setUpdateDateStart(DateUtil.parseYMDHMS(startDate)); + deliverQuery.setUpdateDateEnd(DateUtil.parseYMDHMS(endDate)); + list = matDeliverFollowService.query(deliverQuery); + } if(list != null && list.size() > 0){ for(MatdeliverFollowModel data : list){ @@ -773,7 +950,7 @@ public class QhdJbgwInterface { MaternalDeliverModel md = matDeliverService.getOneMatDeliver(data.getDeliverId()); Patients patients = patientsService.findOnePatientById(md.getParentId()); map.put("POSTPARTUMFOLLOWUPID",data.getId()); - map.put("MATERNALINFOID",patients.getId()); + map.put("MATERNALINFOID", patients.getId()); map.put("NAME",patients.getUsername()); if(data.getVisitDate() != null){ map.put("FOLLOWUPDATE",DateUtil.getyyyy_MM_dd(data.getVisitDate())); @@ -887,11 +1064,18 @@ public class QhdJbgwInterface { * @return */ public List> getCh42fs(String startDate,String endDate){ + List list = null; List> mList = new ArrayList>(); - PostReviewQuery mongoQuery = new PostReviewQuery(); - mongoQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); - mongoQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); - List list = postReviewService.findWithList(mongoQuery); + PostReviewQuery mongoQuery1 = new PostReviewQuery(); + mongoQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + mongoQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + list = postReviewService.findWithList(mongoQuery1); + if(null == list || list.size() == 0){ + PostReviewQuery mongoQuery = new PostReviewQuery(); + mongoQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); + mongoQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); + list = postReviewService.findWithList(mongoQuery); + } if(list != null && list.size() > 0){ for(PostReviewModel data : list){ try{ @@ -1321,11 +1505,18 @@ public class QhdJbgwInterface { * @return */ public List> getEb(String startDate,String endDate){ + List list = null; List> mList = new ArrayList>(); - BabyCheckModelQuery babyQuery = new BabyCheckModelQuery(); - babyQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); - babyQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); - List list = babyCheckService.queryBabyCheckRecord(babyQuery); + BabyCheckModelQuery babyQuery1 = new BabyCheckModelQuery(); + babyQuery1.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate)); + babyQuery1.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate)); + list = babyCheckService.queryBabyCheckRecord(babyQuery1); + if(null == list || list.size() == 0){ + BabyCheckModelQuery babyQuery = new BabyCheckModelQuery(); + babyQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); + babyQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); + list = babyCheckService.queryBabyCheckRecord(babyQuery); + } if(list != null && list.size() > 0){ for(BabyCheckModel babyCheckModel : list){ try{ -- 1.8.3.1