diff --git a/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java b/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java index 9977d99..0330ffe 100644 --- a/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java +++ b/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java @@ -651,9 +651,18 @@ public class ConvertHelper { */ private static String convertNewAntExChuResult(AntExChuModel antExChuModel, BasicConfigService basicConfigService, Map bgMap, String doctorUserName) { + // String antChuStr = JsonUtil.obj2JsonString(antExChuModel); + // JSONObject antChuJson = JsonUtil.getObj(antChuStr); + JSONObject antChuJson = new JSONObject(); + //诊断时间 + antChuJson.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); + //末次月经 + antChuJson.put("lastMenses", DateUtil.getyyyy_MM_dd(antExChuModel.getLastMenses())); - String antChuStr = JsonUtil.obj2JsonString(antExChuModel); - JSONObject antChuJson = JsonUtil.getObj(antChuStr); + Date dueDate = DateUtil.addDay(antExChuModel.getLastMenses(), 280); + + //预产期 + antChuJson.put("dueDate", DateUtil.getyyyy_MM_dd(dueDate)); //孕期当前体重 antChuJson.put("weight", StringUtils.unitHandle(antExChuModel.getWeight(), UnitConstants.KG)); @@ -665,65 +674,125 @@ public class ConvertHelper { antChuJson.put("fuwei", StringUtils.unitHandle(antExChuModel.getFuwei(), UnitConstants.CM)); //身高 antChuJson.put("height", StringUtils.unitHandle(antExChuModel.getHeight(), UnitConstants.CM)); - //既往史 + /**妇科检查**/ + + //外阴 + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getVulvaSele())) { + if ("2".equals(antExChuModel.getVulvaSele())) { + antChuJson.put("vulva", "未见异常"); + } else if ("1".equals(antExChuModel.getVulvaSele())) { + antChuJson.put("vulva", antExChuModel.getVulva()); + } + } else {//空 + antChuJson.put("vulva", antExChuModel.getVulva()); + } + //阴道 + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getVaginaSele())) { + if ("2".equals(antExChuModel.getVaginaSele())) { + antChuJson.put("vagina", "未见异常"); + } else if ("1".equals(antExChuModel.getVaginaSele())) { + antChuJson.put("vagina", antExChuModel.getVagina()); + } + } else {//空 + antChuJson.put("vagina", antExChuModel.getVagina()); + } + //宫颈 + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getCervicalSele())) { + if ("2".equals(antExChuModel.getCervicalSele())) { + antChuJson.put("cervical", "未见异常"); + } else if ("1".equals(antExChuModel.getCervicalSele())) { + antChuJson.put("cervical", antExChuModel.getCervical()); + } + } else {//空 + antChuJson.put("cervical", antExChuModel.getCervical()); + } + //子宫 + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getUterusSele())) { + if ("2".equals(antExChuModel.getUterusSele())) { + antChuJson.put("uterus", "未见异常"); + } else if ("1".equals(antExChuModel.getUterusSele())) { + antChuJson.put("uterus", antExChuModel.getUterus()); + } + } else {//空 + antChuJson.put("uterus", antExChuModel.getUterus()); + } + //附件 + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getFujianSele())) { + if ("1".equals(antExChuModel.getFujianSele())) { + antChuJson.put("fujian", antExChuModel.getFujian()); + } else if ("2".equals(antExChuModel.getFujianSele())) { + antChuJson.put("fujian", "未见异常"); + } + } else {//空 + antChuJson.put("fujian", antExChuModel.getFujian()); + } + String pastHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getPastHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getPastHistory(), Map.class); pastHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //既往史 antChuJson.put("pastHistory", pastHistory); - //家族史 String familyHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getFamilyHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getFamilyHistory(), Map.class); familyHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //家族史 antChuJson.put("familyHistory", familyHistory); - //个人史 String personalHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getPersonalHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getPersonalHistory(), Map.class); personalHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //个人史 antChuJson.put("personalHistory", personalHistory); - //疫苗接种史 String ymjzHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getYmjzHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getYmjzHistory(), Map.class); ymjzHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //疫苗接种史 antChuJson.put("ymjzHistory", ymjzHistory); - //药物过敏史 + String ywgmHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getYwgmHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getYwgmHistory(), Map.class); ywgmHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //药物过敏史 antChuJson.put("ywgmHistory", ywgmHistory); - //妇科手术史 String fksxHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getFksxHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getFksxHistory(), Map.class); fksxHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //妇科手术史 antChuJson.put("fksxHistory", fksxHistory); - //叶酸服用 String ysfyHistory = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getYsfyHistory())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getYsfyHistory(), Map.class); ysfyHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //叶酸服用 antChuJson.put("ysfyHistory", ysfyHistory); - //本次妊娠情况 + String cestationInfo = ""; if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getCestationInfo())) { Map map1 = JsonUtil.jkstr2Obj(antExChuModel.getCestationInfo(), Map.class); cestationInfo = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService); } + //本次妊娠情况 antChuJson.put("cestationInfo", cestationInfo); + //孕产史 //孕次 antChuJson.put("pregnancyTimes", StringUtils.unitHandle(antExChuModel.getPregnancyTimes(), UnitConstants.CI)); + //心脏 + antChuJson.put("heart", antExChuModel.getHeart()); + //肺部 + antChuJson.put("lungs", antExChuModel.getLungs()); //产次 antChuJson.put("prodTime", StringUtils.unitHandle(antExChuModel.getProdTime(), UnitConstants.CI)); //顺产 @@ -743,11 +812,11 @@ public class ConvertHelper { //身高 antChuJson.put("height", StringUtils.unitHandle(antExChuModel.getHeight(), UnitConstants.CM)); //体重 - antChuJson.put("weight", StringUtils.unitHandle(antExChuModel.getWeight(), UnitConstants.KG)); + antChuJson.put("weight", antExChuModel.getWeight()); //体重指数 antChuJson.put("baricIndex", antExChuModel.getBaricIndex()); //孕前体重 - antChuJson.put("yqWeight", StringUtils.unitHandle(antExChuModel.getYqWeight(), UnitConstants.KG)); + antChuJson.put("yqWeight", antExChuModel.getYqWeight()); // 血压 String ssy = ""; String szy = ""; @@ -757,13 +826,14 @@ public class ConvertHelper { szy = chBpMap.get("szy"); } //血压 - antChuJson.put("bp", StringUtils.unitHandle(ssy + "/" + szy, UnitConstants.MMHG)); + antChuJson.put("bp", ssy + "/" + szy); //流产 StringBuffer abortion = new StringBuffer(); + //流产 if (antExChuModel.getAbortion() != null) { boolean isAppend = false; - abortion.append(StringUtils.unitHandle(antExChuModel.getAbortion(), UnitConstants.CI) == null ? "" : StringUtils.unitHandle(antExChuModel.getAbortion(), UnitConstants.CI)); + abortion.append(StringUtils.unitHandle(antExChuModel.getAbortion(), UnitConstants.CI)); if (antExChuModel.getAbortionZR() != null || antExChuModel.getAbortionRG() != null || antExChuModel.getYaowu() != null) { isAppend = true; abortion.append("("); @@ -784,7 +854,9 @@ public class ConvertHelper { } } //流产 - antChuJson.put("abortion", abortion); + antChuJson.put("abortion", abortion.toString()); + //孕产史 + antChuJson.put("hisGestation", "孕次:"+StringUtils.unitHandle(antExChuModel.getPregnancyTimes(), UnitConstants.CI)+" 产次:"+StringUtils.unitHandle(antExChuModel.getProdTime(), UnitConstants.CI)+" 流产次:"+StringUtils.unitHandle(antExChuModel.getAbortion(), UnitConstants.CI)); try { //国家高危+自定义高危 List highrisks = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); @@ -887,7 +959,7 @@ public class ConvertHelper { antChuJson.put("bld", antExChuModel.getBld()); antChuJson.put("ncgOther", antExChuModel.getNcgOther()); //血糖 - antChuJson.put("bloodSugar", StringUtils.unitHandle(antExChuModel.getBloodSugar(), UnitConstants.MMOLL)); + antChuJson.put("bloodSugar", antExChuModel.getBloodSugar()); /**肝功能**/ antChuJson.put("xqgbzam", StringUtils.unitHandle(antExChuModel.getXqgbzam(), UnitConstants.UL)); antChuJson.put("xqgczam", StringUtils.unitHandle(antExChuModel.getXqgczam(), UnitConstants.UL)); @@ -911,13 +983,14 @@ public class ConvertHelper { - //孕前体重指数 yqWeight + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(antExChuModel.getYqWeight()) && com.lyms.platform.common.utils.StringUtils.isNotEmpty(antExChuModel.getHeight())) { try { //体重指数计算规则:孕前体重/身高(单位米)的平方 java.text.DecimalFormat df = new java.text.DecimalFormat("#.#"); double tzzs = Double.parseDouble(antExChuModel.getYqWeight()) / Math.pow(Double.parseDouble(antExChuModel.getHeight()) / 100, 2); - antChuJson.put("tzzs", StringUtils.unitHandle(df.format(tzzs), UnitConstants.BMI)); + //孕前体重指数 yqWeight + antChuJson.put("tzzs", df.format(tzzs)); } catch (Exception e) { ExceptionUtils.catchException(e, "体重指数计算错误"); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java index 6e29915..579ec25 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java @@ -157,7 +157,6 @@ public class BookbuildingFacade { private CdfyHisService cdfyHisService; - /** * 根据患者的建档ID,查询还未使用的免费产检查券 * @@ -267,8 +266,7 @@ public class BookbuildingFacade { //承德市妇幼通过就诊卡号查询到病人id保存下来 - if ("2100001291".equals(patient.getHospitalId()) && StringUtils.isNotEmpty(yunRequest.getVcCardNo())) - { + if ("2100001291".equals(patient.getHospitalId()) && StringUtils.isNotEmpty(yunRequest.getVcCardNo())) { patient.setBlNum(cdfyHisService.getIdByVcCardNo(yunRequest.getVcCardNo())); } @@ -404,10 +402,11 @@ public class BookbuildingFacade { /** * 添加或更新追访信息 + * * @param userId * @param patient */ - public void addTrackDownInfo(final Integer userId, final Patients patient) { + public void addTrackDownInfo(final Integer userId, final Patients patient) { commonThreadPool.execute(new Runnable() { @Override @@ -425,20 +424,20 @@ public class BookbuildingFacade { } else {//不存在查询居民健康档案是否存在追访 downRecordQuery = new TrackDownRecordQuery(); downRecordQuery.setHospitalId(patient.getHospitalId()); - if(StringUtils.isNotEmpty(patient.getCardNo())){ + if (StringUtils.isNotEmpty(patient.getCardNo())) { downRecordQuery.setCardNo(patient.getCardNo()); - }else if(StringUtils.isNotEmpty(patient.getPhone())){ + } else if (StringUtils.isNotEmpty(patient.getPhone())) { downRecordQuery.setPhone(patient.getPhone()); } records = trackDownRecordService.queryTrackDown(downRecordQuery); - if(CollectionUtils.isNotEmpty(records)){ + if (CollectionUtils.isNotEmpty(records)) { TrackDownRecord trackDownRecord1 = records.get(0); trackDownRecord.setId(trackDownRecord1.getId()); } } - int week = DateUtil.getWeek2(patient.getLastMenses(),new Date()); + int week = DateUtil.getWeek2(patient.getLastMenses(), new Date()); - if(week>20){//不能做产前筛查追访,产前检查追访 + if (week > 20) {//不能做产前筛查追访,产前检查追访 trackDownRecord.setTrackType(TrackDownDateEnums.I.getId()); } @@ -852,7 +851,7 @@ public class BookbuildingFacade { yunBookbuildingService.updatePregnant(patient, id); //更新产后追访信息 - addTrackDownInfo(userId,patient); + addTrackDownInfo(userId, patient); operateLogFacade.addModifyOptLog(userId, Integer.valueOf(beforePatient.getHospitalId()), beforePatient, patient, OptActionEnums.UPDATE.getId(), "孕妇建档修改"); @@ -908,21 +907,18 @@ public class BookbuildingFacade { //只查询当前医院所在市的所有建档记录 Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId)); List hids = new ArrayList<>(); - if (org != null) - { + if (org != null) { OrganizationQuery query = new OrganizationQuery(); query.setYn(YnEnums.YES.getId()); query.setCityId(org.getCityId()); query.setProvinceId(org.getProvinceId()); List list = organizationService.queryHospitalIds(query); - if (CollectionUtils.isNotEmpty(list)) - { + if (CollectionUtils.isNotEmpty(list)) { for (Organization organization : list) { hids.add(String.valueOf(organization.getId())); } } - if (CollectionUtils.isNotEmpty(hids)) - { + if (CollectionUtils.isNotEmpty(hids)) { patientsQuery.setHospitalList(hids); } } @@ -937,13 +933,10 @@ public class BookbuildingFacade { patientsQuery.setVcCardNos(dzfyHisService.getDzVcCardNos(bookbuildingQueryRequest.getVcCardNo())); } //承德通过就诊卡号查询查询到病人id 然后用病人id和就诊卡号查询建档记录 - else if ("2100001291".equals(hospitalId)) - { + else if ("2100001291".equals(hospitalId)) { String blNum = cdfyHisService.getIdByVcCardNo(bookbuildingQueryRequest.getVcCardNo()); patientsQuery.setBlNum(blNum); - } - else - { + } else { patientsQuery.setVcCardNo(bookbuildingQueryRequest.getVcCardNo()); } @@ -951,11 +944,9 @@ public class BookbuildingFacade { //优先查询本院通过就诊卡 List localPatients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); - if ("2100001291".equals(hospitalId)) - { + if ("2100001291".equals(hospitalId)) { patientsQuery.setBlNum(null); - if (CollectionUtils.isEmpty(localPatients)) - { + if (CollectionUtils.isEmpty(localPatients)) { patientsQuery.setVcCardNo(bookbuildingQueryRequest.getVcCardNo()); localPatients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); } @@ -1230,19 +1221,26 @@ public class BookbuildingFacade { patient.setServiceType(yunRequest.getServiceType()); // patient.setLastMenses(DateUtil.parseYMD(yunRequest.getLastMenstrualPeriod())); - //建档开通增值服务,以前数据 - if (CollectionUtils.isNotEmpty(yunRequest.getSerInfos())) { - for (Map serInfo : yunRequest.getSerInfos()) { - //标准服务 - if (Integer.parseInt(serInfo.get("serType")) == PatientSerEnums.SerTypeEnums.bzfw.getId()) { - patient.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); - patient.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); - } else if (Integer.parseInt(serInfo.get("serType")) == PatientSerEnums.SerTypeEnums.yqjzzd.getId()) {//增值服务:修改为孕期精准指导 - patient.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId()); - patient.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId()); - break; + try { + //建档开通增值服务,以前数据 + if (CollectionUtils.isNotEmpty(yunRequest.getSerInfos())) { + for (Map serInfo : yunRequest.getSerInfos()) { + if(serInfo.get("serType")==null){ + continue; + } + //标准服务 + if (Integer.parseInt(serInfo.get("serType")) == PatientSerEnums.SerTypeEnums.bzfw.getId()) { + patient.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); + patient.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); + } else if (Integer.parseInt(serInfo.get("serType")) == PatientSerEnums.SerTypeEnums.yqjzzd.getId()) {//增值服务:修改为孕期精准指导 + patient.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId()); + patient.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId()); + break; + } } } + } catch (Exception e) { + e.printStackTrace(); } patient.setDueDate(DateUtil.parseYMD(yunRequest.getDueDate()));