From 9deab76c9647cfbf38cdded48bef3ea0eabec914 Mon Sep 17 00:00:00 2001 From: yangfei Date: Mon, 21 Aug 2017 14:45:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AC=E5=8A=9B=E8=AF=8A=E6=96=AD=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/operate/web/facade/BabyEarFacade.java | 265 ++++++++++++--------- 1 file changed, 158 insertions(+), 107 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java index d21fe3d..b31fd88 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java @@ -26,6 +26,7 @@ import com.lyms.platform.permission.service.*; import com.lyms.platform.pojo.BabyModel; import com.lyms.platform.pojo.BasicConfig; import com.lyms.platform.pojo.PersonModel; +import com.lyms.platform.query.BabyModelQuery; import com.lyms.platform.query.PersonModelQuery; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; @@ -163,7 +164,7 @@ public class BabyEarFacade { childrenRecord.setCreateTime(baby.getCreated()); childrenRecord.setBirthHospital(baby.getHospitalId()); childrenRecord.setRemark(baby.getMremark()); - if(baby.getBabyHeight()!=null){ + if (baby.getBabyHeight() != null) { childrenRecord.setHeight(Float.valueOf(baby.getBabyHeight())); } // childrenRecord.setBirthNum(baby.get); @@ -181,7 +182,7 @@ public class BabyEarFacade { public BaseResponse addOrUpdateBabyEar(BabyEarAddRequest babyEarAddRequest, Integer userId) { BabyEarBase babyEarBase = babyEarAddRequest.getBase(); //获取儿童信息 - IBasicRequestConvert convert =babyEarBase; + IBasicRequestConvert convert = babyEarBase; //儿童基本信息 BabyModel baby = convert.convertToDataModel(); @@ -192,33 +193,59 @@ public class BabyEarFacade { //母亲信息 BabyPatientExtendEarMotherRequest babyPatientExtendEarMotherRequest = babyEarAddRequest.getPatientExtendEarMother(); - BabyPatientExtendEarMother babyPatientExtendEarMother=null; - if(null!=babyPatientExtendEarMotherRequest){ - babyPatientExtendEarMother= babyPatientExtendEarMotherRequest.convertToDataModel(); + BabyPatientExtendEarMother babyPatientExtendEarMother = null; + if (null != babyPatientExtendEarMotherRequest) { + babyPatientExtendEarMother = babyPatientExtendEarMotherRequest.convertToDataModel(); } String hId = autoMatchFacade.getHospitalId(userId); if (null != baby) { //处理儿童person信息 String pid = handBabyPerson(baby).getId(); + //儿童基本信息id String id = babyEarAddRequest.getBase().getId(); + //babyId 不存在新增 String babyPatientId = baby.getId(); if (StringUtils.isEmpty(baby.getId())) { baby.setPid(pid); baby.setHospitalId(hId); baby.setYn(1); baby.setCreated(new Date()); - babyPatientId = babyService.addOneBaby(baby).getId(); - addMysqlBabyRecord(babyEarAddRequest.getBase()); + BabyModelQuery babyQuery = new BabyModelQuery(); + babyQuery.setPid(pid); + babyQuery.setHospitalId(hId); + List babyModels = babyService.queryBabyWithQuery(babyQuery); + if (CollectionUtils.isNotEmpty(babyModels)) {//修改 + BabyModel babyModel = babyModels.get(0); + baby.setId(babyModel.getId()); + babyService.updateOneBaby(baby, babyModel.getId()); + babyPatientId = babyModel.getId(); + } else {//新增 + //babyId + babyPatientId = babyService.addOneBaby(baby).getId(); + } } + + //数据转换 BabyPatientExtendEar babyPatientExtendEar = new BabyPatientExtendEar(); babyPatientExtendEar.setmHighRiskFactorId(babyEarBase.getmHighRiskFactorId()); babyPatientExtendEar.setAdmissNo(babyEarBase.getAdmissNo()); babyPatientExtendEar.setDischargeDiagnosis(babyEarBase.getDischargeDiagnosis()); babyPatientExtendEar.setHighRiskCause(babyEarBase.getHighRiskCause()); babyPatientExtendEar.setHighRiskCause(babyEarBase.getHighRiskCause()); - - if (StringUtils.isEmpty(id)) { + //根据babyId查询是否存 + BabyPatientExtendEarQuery earQuery = new BabyPatientExtendEarQuery(); + earQuery.setBabyPatientId(babyPatientId); + List babyPatientExtendEars = babyPatientExtendEarService.queryBabyPatientExtendEar(earQuery); + + if(CollectionUtils.isNotEmpty(babyPatientExtendEars)){//修改 + BabyPatientExtendEar babyPatientExtendEar1 = babyPatientExtendEars.get(0); + babyPatientExtendEar.setId(babyPatientExtendEar1.getId()); + babyPatientExtendEar.setLastUpdateDate(new Date()); + babyPatientExtendEar.setLastUpdateHospitalId(hId); + babyPatientExtendEar.setLastUpdateUserId(userId + ""); + babyPatientExtendEarService.updateBabyPatientExtendEar(babyPatientExtendEar); + }else{ babyPatientExtendEar.setCreateDate(new Date()); babyPatientExtendEar.setCreateHospitalId(hId); babyPatientExtendEar.setCreateUserId(userId + ""); @@ -229,17 +256,8 @@ public class BabyEarFacade { babyPatientExtendEar.setStatus(1); babyPatientExtendEar.setBabyPatientId(babyPatientId); babyPatientExtendEarService.addBabyPatientExtendEar(babyPatientExtendEar); - } else { - babyPatientExtendEar.setId(id); - babyPatientExtendEar.setLastUpdateDate(new Date()); - babyPatientExtendEar.setLastUpdateHospitalId(hId); - babyPatientExtendEar.setLastUpdateUserId(userId + ""); - babyPatientExtendEarService.updateBabyPatientExtendEar(babyPatientExtendEar); } - if (StringUtils.isEmpty(babyPatientExtendEarBirth.getBabyPatientId())) { - babyPatientExtendEarBirth.setBabyPatientId(babyPatientId); - } if (null != babyPatientExtendEarBirth) babyPatientExtendEarBirth.setBabyPatientId(babyPatientId); if (null != babyPatientExtendEarFamily) { @@ -248,26 +266,40 @@ public class BabyEarFacade { if (null != babyPatientExtendEarMother) { babyPatientExtendEarMother.setBabyPatientId(babyPatientId); } - //判断是否是新增 - if (StringUtils.isEmpty(babyPatientExtendEarBirth.getId())) { + + BabyPatientExtendEarBirthQuery birthQuery = new BabyPatientExtendEarBirthQuery(); + birthQuery.setBabyPatientId(babyPatientId); + List babyPatientExtendEarBirths = babyPatientExtendEarBirthService.queryBabyPatientExtendEarBirth(birthQuery); + if(CollectionUtils.isNotEmpty(babyPatientExtendEarBirths)){ + BabyPatientExtendEarBirth babyPatientExtendEarBirth1 = babyPatientExtendEarBirths.get(0); + babyPatientExtendEarBirth.setId(babyPatientExtendEarBirth1.getId()); + babyPatientExtendEarBirthService.updateBabyPatientExtendEarBirth(babyPatientExtendEarBirth); + }else{ babyPatientExtendEarBirth.setId(UUID.randomUUID().toString().replace("-", "")); babyPatientExtendEarBirthService.addBabyPatientExtendEarBirth(babyPatientExtendEarBirth); - } else { - babyPatientExtendEarBirthService.updateBabyPatientExtendEarBirth(babyPatientExtendEarBirth); } - //判断是否是新增 - if (StringUtils.isEmpty(babyPatientExtendEarFamily.getId())) { + BabyPatientExtendEarFamilyQuery familyQuery = new BabyPatientExtendEarFamilyQuery(); + familyQuery.setBabyPatientId(babyPatientId); + List babyPatientExtendEarFamilies = babyPatientExtendEarFamilyService.queryBabyPatientExtendEarFamily(familyQuery); + if(CollectionUtils.isNotEmpty(babyPatientExtendEarFamilies)){ + BabyPatientExtendEarFamily babyPatientExtendEarFamily1 = babyPatientExtendEarFamilies.get(0); + babyPatientExtendEarFamily.setId(babyPatientExtendEarFamily1.getId()); + babyPatientExtendEarFamilyService.updateBabyPatientExtendEarFamily(babyPatientExtendEarFamily); + }else{ babyPatientExtendEarFamily.setId(UUID.randomUUID().toString().replace("-", "")); babyPatientExtendEarFamilyService.addBabyPatientExtendEarFamily(babyPatientExtendEarFamily); - } else { - babyPatientExtendEarFamilyService.updateBabyPatientExtendEarFamily(babyPatientExtendEarFamily); } - //判断是否是新增 - if (StringUtils.isEmpty(babyPatientExtendEarMother.getId())) { + + BabyPatientExtendEarMotherQuery motherQuery = new BabyPatientExtendEarMotherQuery(); + motherQuery.setBabyPatientId(babyPatientId); + List babyPatientExtendEarMothers = babyPatientExtendEarMotherService.queryBabyPatientExtendEarMother(motherQuery); + if(CollectionUtils.isNotEmpty(babyPatientExtendEarMothers)){ + BabyPatientExtendEarMother babyPatientExtendEarMother1 = babyPatientExtendEarMothers.get(0); + babyPatientExtendEarMother.setId(babyPatientExtendEarMother1.getId()); + babyPatientExtendEarMotherService.updateBabyPatientExtendEarMother(babyPatientExtendEarMother); + }else { babyPatientExtendEarMother.setId(UUID.randomUUID().toString().replace("-", "")); babyPatientExtendEarMotherService.addBabyPatientExtendEarMother(babyPatientExtendEarMother); - } else { - babyPatientExtendEarMotherService.updateBabyPatientExtendEarMother(babyPatientExtendEarMother); } } return RespBuilder.buildSuccess(baby.getId()); @@ -295,7 +327,7 @@ public class BabyEarFacade { babyEarBase.setBarCode(babyPatientExtendEar.getBarCode()); babyEarBase.setCreateUserId(babyPatientExtendEar.getCreateUserId()); //母亲孕期高危因素 - if(babyPatientExtendEar.getmHighRiskFactorId()!=null){ + if (babyPatientExtendEar.getmHighRiskFactorId() != null) { String[] highFactors = babyPatientExtendEar.getmHighRiskFactorId().split(","); List ids = Arrays.asList(highFactors); @@ -305,15 +337,15 @@ public class BabyEarFacade { babyEarBase.setmHighRiskFactorList(checkList); } //听力高危因素 - if(babyPatientExtendEar.getHighRiskCause()!=null){ + if (babyPatientExtendEar.getHighRiskCause() != null) { List highArr = new ArrayList(); String[] highFactors = babyPatientExtendEar.getHighRiskCause().split(","); for (String hf : highFactors) { if (StringUtils.isNotEmpty(hf)) { String name = HighRiskEnum.getTitle(Integer.parseInt(hf)); JSONObject confiJo = new JSONObject(); - confiJo.put("id",hf); - confiJo.put("name",name); + confiJo.put("id", hf); + confiJo.put("name", name); highArr.add(confiJo); } } @@ -357,6 +389,7 @@ public class BabyEarFacade { /** * 查看页面儿童听筛建档 + * * @param babyId */ public BaseResponse getBabyEarInfo(String babyId) { @@ -450,6 +483,7 @@ public class BabyEarFacade { /** * 儿童出生信息-数据转换 + * * @param babyPatientExtendEarFamily 儿童家庭信息 * @return */ @@ -459,8 +493,8 @@ public class BabyEarFacade { babyEarFamilyView.setBadLifeHistory(babyPatientExtendEarFamily.getBadLifeHistory()); String deafType = "无"; - if(babyPatientExtendEarFamily.getDeafType()!=null){ - if(babyPatientExtendEarFamily.getDeafType()==1){ + if (babyPatientExtendEarFamily.getDeafType() != null) { + if (babyPatientExtendEarFamily.getDeafType() == 1) { deafType = "有"; } } @@ -468,8 +502,8 @@ public class BabyEarFacade { babyEarFamilyView.setDeafType(deafType); babyEarFamilyView.setDeatRelationship(babyPatientExtendEarFamily.getDeatRelationship()); String proximityType = "无"; - if(babyPatientExtendEarFamily.getProximityType()!=null){ - if(babyPatientExtendEarFamily.getProximityType()==1){ + if (babyPatientExtendEarFamily.getProximityType() != null) { + if (babyPatientExtendEarFamily.getProximityType() == 1) { proximityType = "有"; } } @@ -478,8 +512,10 @@ public class BabyEarFacade { babyEarFamilyView.setProximityRelationship(babyPatientExtendEarFamily.getProximityRelationship()); return babyEarFamilyView; } + /** * 儿童出生信息-数据转换 + * * @param babyPatientExtendEarMother 母亲妊娠信息 * @return */ @@ -497,33 +533,35 @@ public class BabyEarFacade { babyEarMotherView.setBnormalPregnancyHistoryType(babyPatientExtendEarMother.getBnormalPregnancyHistoryType()); return babyEarMotherView; } + /** * 儿童出生信息-数据转换 + * * @param babyPatientExtendEarBirth 儿童出生信息 * @return */ public BabyEarBirthView convertToBabyEarBirthView(BabyPatientExtendEarBirth babyPatientExtendEarBirth) { BabyEarBirthView babyEarBirthView = new BabyEarBirthView(); - babyEarBirthView.setFetuNumber(babyPatientExtendEarBirth.getFetuNumber()+""); - babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber()+""); + babyEarBirthView.setFetuNumber(babyPatientExtendEarBirth.getFetuNumber() + ""); + babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() + ""); babyEarBirthView.setBirthWeight(babyPatientExtendEarBirth.getBirthWeight()); - babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber()+""); + babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() + ""); babyEarBirthView.setBirthWeight(babyPatientExtendEarBirth.getBirthWeight()); - babyEarBirthView.setParturitionType(babyPatientExtendEarBirth.getParturitionType()+""); + babyEarBirthView.setParturitionType(babyPatientExtendEarBirth.getParturitionType() + ""); babyEarBirthView.setTireNumber(babyPatientExtendEarBirth.getTireNumber()); babyEarBirthView.setBirthDefectDesc(babyPatientExtendEarBirth.getBirthDefectDesc()); babyEarBirthView.setBirthInjuryPosition(babyPatientExtendEarBirth.getBirthInjuryPosition()); - babyEarBirthView.setAmnioticFluid(babyPatientExtendEarBirth.getAmnioticFluidType()+""); + babyEarBirthView.setAmnioticFluid(babyPatientExtendEarBirth.getAmnioticFluidType() + ""); String parturitType = "无"; - if(babyPatientExtendEarBirth.getAbnormalParturitionType()!=null){ - if(babyPatientExtendEarBirth.getAbnormalParturitionType() == 1){//有 + if (babyPatientExtendEarBirth.getAbnormalParturitionType() != null) { + if (babyPatientExtendEarBirth.getAbnormalParturitionType() == 1) {//有 parturitType = "有"; - if(babyPatientExtendEarBirth.getAbnormalParturitionPosition()!=null){//异常分娩部位 1=臀部 2=脐带绕颈 3=胎膜早破 - if(babyPatientExtendEarBirth.getAbnormalParturitionPosition() == 1){ + if (babyPatientExtendEarBirth.getAbnormalParturitionPosition() != null) {//异常分娩部位 1=臀部 2=脐带绕颈 3=胎膜早破 + if (babyPatientExtendEarBirth.getAbnormalParturitionPosition() == 1) { parturitType = "有(臀部)"; - }else if(babyPatientExtendEarBirth.getAbnormalParturitionPosition() == 2){ + } else if (babyPatientExtendEarBirth.getAbnormalParturitionPosition() == 2) { parturitType = "有(脐带绕颈)"; - }else if(babyPatientExtendEarBirth.getAbnormalParturitionPosition() == 3){ + } else if (babyPatientExtendEarBirth.getAbnormalParturitionPosition() == 3) { parturitType = "有(胎膜早破)"; } } @@ -531,46 +569,46 @@ public class BabyEarFacade { } babyEarBirthView.setAbnormalParturition(parturitType); String fetuStr = "无"; - if(babyPatientExtendEarBirth.getFetuEmbarrasType()!=null){ - if(babyPatientExtendEarBirth.getFetuEmbarrasType()==1){//有 + if (babyPatientExtendEarBirth.getFetuEmbarrasType() != null) { + if (babyPatientExtendEarBirth.getFetuEmbarrasType() == 1) {//有 fetuStr = "有"; } } babyEarBirthView.setFetuEmbarras(fetuStr); - String apgarScore = babyPatientExtendEarBirth.getApgarScoreOne()+"-"+babyPatientExtendEarBirth.getApgarScoreFive()+"-"+babyPatientExtendEarBirth.getApgarScoreTen(); - if(babyPatientExtendEarBirth.getFetuEmbarras()!=null&&babyPatientExtendEarBirth.getFetuEmbarras()==1){ - apgarScore+="不详"; + String apgarScore = babyPatientExtendEarBirth.getApgarScoreOne() + "-" + babyPatientExtendEarBirth.getApgarScoreFive() + "-" + babyPatientExtendEarBirth.getApgarScoreTen(); + if (babyPatientExtendEarBirth.getFetuEmbarras() != null && babyPatientExtendEarBirth.getFetuEmbarras() == 1) { + apgarScore += "不详"; } babyEarBirthView.setApgarScore(apgarScore); String deformity = "无"; - if(babyPatientExtendEarBirth.getDeformityType()!=null&&babyPatientExtendEarBirth.getDeformityType()==1){ + if (babyPatientExtendEarBirth.getDeformityType() != null && babyPatientExtendEarBirth.getDeformityType() == 1) { deformity = "有"; - if(babyPatientExtendEarBirth.getDeformityPosition()!=null){ - deformity="有("+babyPatientExtendEarBirth.getDeformityPosition()+")"; + if (babyPatientExtendEarBirth.getDeformityPosition() != null) { + deformity = "有(" + babyPatientExtendEarBirth.getDeformityPosition() + ")"; } } babyEarBirthView.setDeformity(deformity); String headTraumaHistory = "无"; - if(babyPatientExtendEarBirth.getHeadTraumaHistory()!=null&&babyPatientExtendEarBirth.getHeadTraumaHistory()==1){ + if (babyPatientExtendEarBirth.getHeadTraumaHistory() != null && babyPatientExtendEarBirth.getHeadTraumaHistory() == 1) { headTraumaHistory = "有"; - if(babyPatientExtendEarBirth.getHeadTraumaDesc()!=null){ - headTraumaHistory="有("+babyPatientExtendEarBirth.getHeadTraumaDesc()+")"; + if (babyPatientExtendEarBirth.getHeadTraumaDesc() != null) { + headTraumaHistory = "有(" + babyPatientExtendEarBirth.getHeadTraumaDesc() + ")"; } } - + babyEarBirthView.setHeadTraumaDesc(headTraumaHistory); String birthInfection = "无"; - if(babyPatientExtendEarBirth.getBirthInfectionType()!=null&&babyPatientExtendEarBirth.getBirthInfectionType()==1){ + if (babyPatientExtendEarBirth.getBirthInfectionType() != null && babyPatientExtendEarBirth.getBirthInfectionType() == 1) { birthInfection = "有"; } babyEarBirthView.setBirthInfectionType(birthInfection); babyEarBirthView.setBirthInfectionCause(babyPatientExtendEarBirth.getBirthInfectionCause()); babyEarBirthView.setBirthCourseDisease(babyPatientExtendEarBirth.getBirthCourseDisease()); String birthIllType = "无"; - if(babyPatientExtendEarBirth.getBirthIllType()!=null&&babyPatientExtendEarBirth.getBirthIllType()==1){ + if (babyPatientExtendEarBirth.getBirthIllType() != null && babyPatientExtendEarBirth.getBirthIllType() == 1) { birthIllType = "有"; } babyEarBirthView.setBirthIllType(birthIllType); @@ -578,32 +616,42 @@ public class BabyEarFacade { babyEarBirthView.setBirthIllCause(babyPatientExtendEarBirth.getBirthIllCause()); babyEarBirthView.setBirthIllDisease(babyPatientExtendEarBirth.getBirthIllDisease()); String earPoisonType = "无"; - if(babyPatientExtendEarBirth.getEarPoisonType()!=null&&babyPatientExtendEarBirth.getEarPoisonType()==1){ + if (babyPatientExtendEarBirth.getEarPoisonType() != null && babyPatientExtendEarBirth.getEarPoisonType() == 1) { earPoisonType = "有"; } babyEarBirthView.setEarPoisonType(earPoisonType); babyEarBirthView.setEarPoison(babyPatientExtendEarBirth.getEarPoisonMap()); - babyEarBirthView.setTympanitisDesc(babyPatientExtendEarBirth.getTympanitisDesc()); + + String tympanitisType = "无"; + if (babyPatientExtendEarBirth.getNicuType() != null && babyPatientExtendEarBirth.getNicuType() == 1) { + tympanitisType = "有"; + if (babyPatientExtendEarBirth.getTympanitisDesc() != null) { + tympanitisType = "有" + babyPatientExtendEarBirth.getTympanitisDesc(); + } + } + + babyEarBirthView.setTympanitisDesc(tympanitisType); + String nicuType = "无"; - if(babyPatientExtendEarBirth.getNicuType()!=null&&babyPatientExtendEarBirth.getNicuType()==1){ + if (babyPatientExtendEarBirth.getNicuType() != null && babyPatientExtendEarBirth.getNicuType() == 1) { nicuType = "有"; } babyEarBirthView.setNicuType(nicuType); babyEarBirthView.setNicuCause(babyPatientExtendEarBirth.getNicuCause()); babyEarBirthView.setNicuContinuedDate(babyPatientExtendEarBirth.getNicuContinuedDate()); String respiratorType = "无"; - if(babyPatientExtendEarBirth.getRespiratorType()!=null&&babyPatientExtendEarBirth.getRespiratorType()==1){ + if (babyPatientExtendEarBirth.getRespiratorType() != null && babyPatientExtendEarBirth.getRespiratorType() == 1) { respiratorType = "有"; } babyEarBirthView.setRespiratorType(respiratorType); babyEarBirthView.setRespiratorContinuedDate(babyPatientExtendEarBirth.getRespiratorContinuedDate()); String outsideResponse = ""; - if(babyPatientExtendEarBirth.getOutsideResponse()!=null){ - if(babyPatientExtendEarBirth.getOutsideResponse()==1){ + if (babyPatientExtendEarBirth.getOutsideResponse() != null) { + if (babyPatientExtendEarBirth.getOutsideResponse() == 1) { outsideResponse = "灵敏"; - }else{ + } else { outsideResponse = "迟钝"; } } @@ -612,8 +660,10 @@ public class BabyEarFacade { babyEarBirthView.setOutsideResponse(outsideResponse); return babyEarBirthView; } + /** * 儿童基础-数据转换 + * * @param babyEarBase * @return */ @@ -658,7 +708,6 @@ public class BabyEarFacade { } - private String getBasicConfig(String id) { if (com.lyms.platform.common.utils.StringUtils.isEmpty(id)) { return ""; @@ -723,7 +772,7 @@ public class BabyEarFacade { query.setBabyId(babyId); query.setStatus(0); query.setSort("create_date"); - List babyPatientExtendEarScreens = babyPatientExtendEarScreenService.queryBabyPatientExtendEarScreen(query); + List babyPatientExtendEarScreens = babyPatientExtendEarScreenService.queryBabyPatientExtendEarScreen(query); List> list = new ArrayList<>(); @@ -748,7 +797,7 @@ public class BabyEarFacade { data.put("screenTypeStr", babyPatientExtendEarScreen.getScreenType() == 1 ? "初筛" : "复筛");//1= 2= data.put("screenType", babyPatientExtendEarScreen.getScreenType()); data.put("checkHospitalId", babyPatientExtendEarScreen.getCheckHospitalId()); - if(babyPatientExtendEarScreen.getCheckHospitalId()!=null){ + if (babyPatientExtendEarScreen.getCheckHospitalId() != null) { data.put("checkHospital", organizationService.getOrganization(Integer.valueOf(babyPatientExtendEarScreen.getCheckHospitalId())).getName()); } data.put("screenDate", DateUtil.getYyyyMmDd(babyPatientExtendEarScreen.getScreenDate())); @@ -765,42 +814,42 @@ public class BabyEarFacade { String name = HighRiskEnum.getTitle(Integer.parseInt(hf)); hfBuff.append(name + "、"); JSONObject confiJo = new JSONObject(); - confiJo.put("id",hf); - confiJo.put("name",name); + confiJo.put("id", hf); + confiJo.put("name", name); highArr.add(confiJo); } } - data.put("highRiskCauseStr",hfBuff.toString()); + data.put("highRiskCauseStr", hfBuff.toString()); data.put("highRiskCause", highArr); } data.put("oaeLeft", babyPatientExtendEarScreen.getOaeLeft()); - data.put("oaeLeftStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getOaeLeft()==null?0:babyPatientExtendEarScreen.getOaeLeft())); + data.put("oaeLeftStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getOaeLeft() == null ? 0 : babyPatientExtendEarScreen.getOaeLeft())); data.put("oaeRight", babyPatientExtendEarScreen.getOaeRight()); - data.put("oaeRightStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getOaeRight()==null?0:babyPatientExtendEarScreen.getOaeRight())); + data.put("oaeRightStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getOaeRight() == null ? 0 : babyPatientExtendEarScreen.getOaeRight())); data.put("aabrLeft", babyPatientExtendEarScreen.getAabrLeft()); - data.put("aabrLeftStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getAabrLeft()==null?0:babyPatientExtendEarScreen.getAabrLeft())); + data.put("aabrLeftStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getAabrLeft() == null ? 0 : babyPatientExtendEarScreen.getAabrLeft())); data.put("aabrRight", babyPatientExtendEarScreen.getAabrRight()); - data.put("aabrRightStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getAabrRight()==null?0:babyPatientExtendEarScreen.getAabrRight())); - data.put("gjb2Del35", babyPatientExtendEarScreen.getGjb2Del35()+""); - data.put("gjb2Del35Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del35()==null?0:babyPatientExtendEarScreen.getGjb2Del35())); - data.put("gjb2Del176", babyPatientExtendEarScreen.getGjb2Del176()+""); - data.put("gjb2Del176Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del176()==null?0:babyPatientExtendEarScreen.getGjb2Del176())); - data.put("gjb2Del235", babyPatientExtendEarScreen.getGjb2Del235()+""); - data.put("gjb2Del235Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del235()==null?0:babyPatientExtendEarScreen.getGjb2Del235())); - data.put("gjb2Del299", babyPatientExtendEarScreen.getGjb2Del299()+""); - data.put("gjb2Del299Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del299()==null?0:babyPatientExtendEarScreen.getGjb2Del299())); - data.put("gjb3Slc26a4538", babyPatientExtendEarScreen.getGjb3Slc26a4538()+""); - data.put("gjb3Slc26a4538Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb3Slc26a4538()==null?0:babyPatientExtendEarScreen.getGjb3Slc26a4538())); - data.put("gjb3Slc26a42168", babyPatientExtendEarScreen.getGjb3Slc26a42168()+""); - data.put("gjb3Slc26a42168Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb3Slc26a42168()==null?0:babyPatientExtendEarScreen.getGjb3Slc26a42168())); - data.put("gjb3Slc26a4Ivs7", babyPatientExtendEarScreen.getGjb3Slc26a4Ivs7()+""); - data.put("gjb3Slc26a4Ivs7Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb3Slc26a4Ivs7()==null?0:babyPatientExtendEarScreen.getGjb3Slc26a4Ivs7())); - data.put("rrna1494", babyPatientExtendEarScreen.getRrna1494()+""); - data.put("rrna1494Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getRrna1494()==null?0:babyPatientExtendEarScreen.getRrna1494())); - data.put("rrna1555", babyPatientExtendEarScreen.getRrna1555()+""); - data.put("rrna1555Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getRrna1555()==null?0:babyPatientExtendEarScreen.getRrna1555())); + data.put("aabrRightStr", BabyEarResultEnums.getTitle(babyPatientExtendEarScreen.getAabrRight() == null ? 0 : babyPatientExtendEarScreen.getAabrRight())); + data.put("gjb2Del35", babyPatientExtendEarScreen.getGjb2Del35() + ""); + data.put("gjb2Del35Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del35() == null ? 0 : babyPatientExtendEarScreen.getGjb2Del35())); + data.put("gjb2Del176", babyPatientExtendEarScreen.getGjb2Del176() + ""); + data.put("gjb2Del176Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del176() == null ? 0 : babyPatientExtendEarScreen.getGjb2Del176())); + data.put("gjb2Del235", babyPatientExtendEarScreen.getGjb2Del235() + ""); + data.put("gjb2Del235Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del235() == null ? 0 : babyPatientExtendEarScreen.getGjb2Del235())); + data.put("gjb2Del299", babyPatientExtendEarScreen.getGjb2Del299() + ""); + data.put("gjb2Del299Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb2Del299() == null ? 0 : babyPatientExtendEarScreen.getGjb2Del299())); + data.put("gjb3Slc26a4538", babyPatientExtendEarScreen.getGjb3Slc26a4538() + ""); + data.put("gjb3Slc26a4538Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb3Slc26a4538() == null ? 0 : babyPatientExtendEarScreen.getGjb3Slc26a4538())); + data.put("gjb3Slc26a42168", babyPatientExtendEarScreen.getGjb3Slc26a42168() + ""); + data.put("gjb3Slc26a42168Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb3Slc26a42168() == null ? 0 : babyPatientExtendEarScreen.getGjb3Slc26a42168())); + data.put("gjb3Slc26a4Ivs7", babyPatientExtendEarScreen.getGjb3Slc26a4Ivs7() + ""); + data.put("gjb3Slc26a4Ivs7Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getGjb3Slc26a4Ivs7() == null ? 0 : babyPatientExtendEarScreen.getGjb3Slc26a4Ivs7())); + data.put("rrna1494", babyPatientExtendEarScreen.getRrna1494() + ""); + data.put("rrna1494Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getRrna1494() == null ? 0 : babyPatientExtendEarScreen.getRrna1494())); + data.put("rrna1555", babyPatientExtendEarScreen.getRrna1555() + ""); + data.put("rrna1555Str", DeafEnums.getTitle(babyPatientExtendEarScreen.getRrna1555() == null ? 0 : babyPatientExtendEarScreen.getRrna1555())); data.put("processOptionType", babyPatientExtendEarScreen.getProcessOptionType());//1=复筛 2=诊断 - data.put("processOptionTypeStr", babyPatientExtendEarScreen.getProcessOptionType()==null?"初诊":babyPatientExtendEarScreen.getProcessOptionType() == 1 ? "复筛" : "诊断");//1=复筛 2=诊断 + data.put("processOptionTypeStr", babyPatientExtendEarScreen.getProcessOptionType() == null ? "初诊" : babyPatientExtendEarScreen.getProcessOptionType() == 1 ? "复筛" : "诊断");//1=复筛 2=诊断 data.put("processOptionDesc", babyPatientExtendEarScreen.getProcessOptionDesc()); data.put("guidOpinion", babyPatientExtendEarScreen.getGuidOpinion()); data.put("checkDoctorId", babyPatientExtendEarScreen.getCheckDoctorId()); @@ -808,7 +857,7 @@ public class BabyEarFacade { data.put("referralDate", DateUtil.getYyyyMmDd(babyPatientExtendEarScreen.getReferralDate())); BabyModel babyModel = babyService.getOneBabyById(babyPatientExtendEarScreen.getBabyId()); if (babyModel != null) { - data.put("monthAge", DateUtil.getBabyMonthAge(babyModel.getBirth(),babyPatientExtendEarScreen.getScreenDate())); + data.put("monthAge", DateUtil.getBabyMonthAge(babyModel.getBirth(), babyPatientExtendEarScreen.getScreenDate())); } return data; } @@ -867,7 +916,7 @@ public class BabyEarFacade { return baseResponse; } - public BaseResponse babyEarInit(){ + public BaseResponse babyEarInit() { Map map = new HashMap(); //胎数 map.put("taishu", InitDataUtils.getTaiShu()); @@ -882,7 +931,7 @@ public class BabyEarFacade { map.put("levelType", levelType); //听力高危因数 - map.put("highRiskConfirms", EnumUtil.toJson(HighRiskEnum.class)); + map.put("highRiskConfirms", EnumUtil.toJson(HighRiskEnum.class)); // 职业类别 List professionTypeResults = basicConfigFacade.getBaseicConfigByParentId(SystemConfig.PROFESSION_TYPE_ID); @@ -897,7 +946,7 @@ public class BabyEarFacade { map.put("serviceStatus", serviceStatus); //医院 - List hospitals = InitDataUtils.getAbortionEnums(); + List hospitals = InitDataUtils.getAbortionEnums(); map.put("liuchan", hospitals); //分娩方式 @@ -909,6 +958,7 @@ public class BabyEarFacade { map.put("expType", expType); return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(map); } + @Autowired private BasicConfigFacade basicConfigFacade; @Autowired @@ -916,6 +966,7 @@ public class BabyEarFacade { /** * 根据查询条件查询听筛列表 + * * @param earScreenListRequest * @return */ @@ -933,7 +984,7 @@ public class BabyEarFacade { List babyPatientExtendEarScreens = babyPatientExtendEarScreenService.queryEarScreenList(screenQuery); List earScreenResults = new ArrayList<>(); - for(BabyPatientExtendEarScreen earScreen : babyPatientExtendEarScreens) { + for (BabyPatientExtendEarScreen earScreen : babyPatientExtendEarScreens) { EarScreenResult screenResult = new EarScreenResult(); screenResult.setId(earScreen.getId()); BabyModel babyModel = babyService.getOneBabyById(earScreen.getBabyId()); @@ -958,10 +1009,10 @@ public class BabyEarFacade { screenResult.setHighRiskCause(hfBuff.toString()); } String srcResult = "通过"; - if(earScreen.getAabrLeft()!=null&&earScreen.getAabrLeft()==-1&&earScreen.getOaeLeft()!=null&&earScreen.getOaeLeft()==-1){ + if (earScreen.getAabrLeft() != null && earScreen.getAabrLeft() == -1 && earScreen.getOaeLeft() != null && earScreen.getOaeLeft() == -1) { srcResult = "不通过"; } - if(earScreen.getOaeRight()!=null&&earScreen.getOaeRight()==-1&&earScreen.getAabrRight()!=null&&earScreen.getAabrRight()==-1){ + if (earScreen.getOaeRight() != null && earScreen.getOaeRight() == -1 && earScreen.getAabrRight() != null && earScreen.getAabrRight() == -1) { srcResult = "不通过"; } screenResult.setSrcResult(srcResult); @@ -981,6 +1032,6 @@ public class BabyEarFacade { pageInfo.setSize(earScreenResults.size()); baseResponse.setPageInfo(pageInfo); baseResponse.setErrormsg("成功"); - return baseResponse; + return baseResponse; } } -- 1.8.3.1