diff --git a/parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java b/parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java index 695d39f..3c66a75 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java @@ -1,6 +1,7 @@ package com.lyms.base.common.service.organ; import java.io.Serializable; +import java.util.List; import com.baomidou.mybatisplus.plugins.Page; import com.lyms.base.common.entity.organ.Organizations; @@ -83,5 +84,16 @@ public interface OrganizationsService extends BaseService { *
  • 修改时间: */ public String getNameById(String id); + + /** + *
  • @Description:通过名称模糊查询医院列表 + *
  • @param name + *
  • @return + *
  • 创建人:xujiahong + *
  • 创建时间:2017年5月15日 + *
  • 修改人: + *
  • 修改时间: + */ + public List selectListByName(String name); } diff --git a/parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java b/parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java index f809f31..baaeef1 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java @@ -1,11 +1,14 @@ package com.lyms.base.common.service.organ.impl; import java.io.Serializable; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; +import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.lyms.base.common.dao.organ.OrganizationsMapper; @@ -84,4 +87,15 @@ public class OrganizationsServiceImpl extends ServiceImpl selectListByName(String name) { + if(StringUtils.isEmpty(name)){ + return null; + } + EntityWrapper ew = new EntityWrapper(); + ew.where("1=1"); + ew.like("NAME", name); + return this.selectList(ew); + } + } diff --git a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java index 5b69ea1..f6e337d 100644 --- a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java +++ b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java @@ -71,8 +71,8 @@ public class ChildbirthNewbornServiceImpl extends ServiceImpl listByCid(String cid) { EntityWrapper wrapper = new EntityWrapper(); - wrapper.eq("CID", cid); - wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 + wrapper.where("CID={0}", cid); + wrapper.and("IF_DEL={0}", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 return baseMapper.selectList(wrapper); } diff --git a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java index d5ab516..bcda60c 100644 --- a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java +++ b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java @@ -49,8 +49,8 @@ public class ChildbirthTaiServiceImpl extends ServiceImpl listByCid(String cid) { EntityWrapper wrapper = new EntityWrapper<>(); - wrapper.eq("CID", cid); - wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 + wrapper.where("CID={0}", cid); + wrapper.and("IF_DEL={0}", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 return baseMapper.selectList(wrapper); } diff --git a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java index 45b62d1..5d29805 100644 --- a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java +++ b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java @@ -49,8 +49,8 @@ public class ChildbirthTaipanServiceImpl extends ServiceImpl listByCid(String cid) { EntityWrapper wrapper = new EntityWrapper<>(); - wrapper.eq("CID", cid); - wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 + wrapper.where("CID={0}", cid); + wrapper.and("IF_DEL={0}", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 return baseMapper.selectList(wrapper); } diff --git a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java index 091df1c..509234a 100644 --- a/parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java +++ b/parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java @@ -323,21 +323,21 @@ public class WomanFetationRecordServiceImpl extends ServiceImpl highriskConfList = diagnoseInfoService.getLastHighrisk(dbFetationRecord.getWomanPersonId()); -// if(highriskConfList!=null && !highriskConfList.isEmpty()){ -// for(HighriskConf hc : highriskConfList){ -// Map map = new HashMap<>(); -// map.put("id", hc.getId()); -// map.put("name", hc.getName()); -// map.put("color", hc.getColortext()); -// map.put("code", hc.getColorcode()); -// riskFactor.add(map); -// if(hc.getGrade()!=null){ -// BigDecimal big = new BigDecimal(hc.getGrade()); -// riskScore = riskScore.add(big); -// } -// } -// } + List highriskConfList = diagnoseInfoService.getLastHighrisk(dbFetationRecord.getWomanPersonId()); + if(highriskConfList!=null && !highriskConfList.isEmpty()){ + for(HighriskConf hc : highriskConfList){ + Map map = new HashMap<>(); + map.put("id", hc.getId()); + map.put("name", hc.getName()); + map.put("color", hc.getColortext()); + map.put("code", hc.getColorcode()); + riskFactor.add(map); + if(hc.getGrade()!=null){ + BigDecimal big = new BigDecimal(hc.getGrade()); + riskScore = riskScore.add(big); + } + } + } dataMap.put("riskFactor", riskFactor);//高危因素列表 dataMap.put("riskScore", riskScore.toString());// 高危评分 diff --git a/parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java b/parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java index 6f8562a..e957d1f 100644 --- a/parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java +++ b/parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java @@ -12,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; +import com.lyms.base.common.entity.organ.Organizations; import com.lyms.base.common.entity.region.Regions; +import com.lyms.base.common.service.organ.OrganizationsService; import com.lyms.base.common.service.region.RegionsService; import com.lyms.hospital.entity.history.HistorySource; import com.lyms.hospital.enums.business.ServiceStatusEnums; @@ -27,10 +29,11 @@ import com.lyms.web.controller.BaseController; * 公用接口-前端控制器 *

    * - * []查询病史配置
    - * 查询省市区数据
    - * 查询字典数据
    + * []查询病史配置
    + * 查询省市区数据
    + * 查询字典数据
    * []获取当前服务器时间
    + * []获取医院数据
    * * @author xujiahong * @since 2017-04-21 @@ -43,6 +46,33 @@ public class CommonApiController extends BaseController { private RegionsService regionService; @Autowired private HistorySourceService historySourceService; + @Autowired + private OrganizationsService orgService; + + /** + *
  • @Description:获取医院数据 + *
  • @param name + *
  • @return + *
  • 创建人:xujiahong + *
  • 创建时间:2017年5月15日 + *
  • 修改人: + *
  • 修改时间: + */ + @RequestMapping(value = "/queryHospitals", method = RequestMethod.GET) + @ResponseBody + public AjaxResult queryHospital(String name) { + List list = orgService.selectListByName(name); + List> dataList = new ArrayList<>(); + if(list!=null && !list.isEmpty()){ + for(Organizations org : list){ + Map map = new HashMap<>(); + map.put("id", org.getId()); + map.put("name", org.getName()); + dataList.add(map); + } + } + return AjaxResult.returnSuccess(dataList); + } /** *
  • @Description:获取当前服务器时间 diff --git a/parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java b/parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java index 4077c60..339de51 100644 --- a/parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java +++ b/parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java @@ -17,6 +17,9 @@ import com.lyms.base.common.entity.user.Users; import com.lyms.base.common.service.organ.OrganizationsService; import com.lyms.hospital.entity.childbirth.ChildbirthInfo; import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo; +import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; +import com.lyms.hospital.entity.childbirth.ChildbirthTai; +import com.lyms.hospital.entity.childbirth.ChildbirthTaipan; import com.lyms.hospital.entity.woman.WomanFetationRecord; import com.lyms.hospital.enums.business.CfEnums; import com.lyms.hospital.enums.business.CosEnums; @@ -47,24 +50,72 @@ import com.lyms.web.controller.BaseController; * []获取分娩页面的字典数据
    * [--]保存分娩记录
    * []依据cardNo或vcCardNo查询孕妇分娩记录
    - * 查看表单
    + * []查看表单
    * 查看页面
    * 删除分娩信息
    * - * @author xujiahong + * @author xujiahong * @since 2017-03-31 */ @Controller @RequestMapping("/childbirth") public class ChildbirthController extends BaseController { - + @Autowired private WomanFetationRecordService fetationService; @Autowired private ChildbirthInfoService birthService; @Autowired private OrganizationsService orgService; - + + /** + *
  • @Description:查看分娩页面 + *
  • @param id + *
  • @return + *
  • 创建人:xujiahong + *
  • 创建时间:2017年5月15日 + *
  • 修改人: + *
  • 修改时间: + */ + @RequestMapping(value = "/findMatDeliverData", method = RequestMethod.GET) + @ResponseBody + public AjaxResult getDetailForPage(String id) { + if (StringUtils.isEmpty(id)) { + return AjaxResult.returnFail("分娩ID不能为空"); + } + ChildbirthInfoVo vo = birthService.selectChildbirthVo(id); + if (vo == null || vo.getInfo() == null) {// 未找到分娩记录 + return AjaxResult.returnSuccess(); + } + ChildbirthInfo info = vo.getInfo(); + List newbornList = vo.getNewbornList(); + List taipanList = vo.getTaipanList(); + List taiList = vo.getTaiList(); + + return AjaxResult.returnFail(); + } + + /** + *
  • @Description:查看分娩表单 + *
  • @param id + *
  • @return + *
  • 创建人:xujiahong + *
  • 创建时间:2017年5月15日 + *
  • 修改人: + *
  • 修改时间: + */ + @RequestMapping(value = "/matdel", method = RequestMethod.GET) + @ResponseBody + public AjaxResult getDetailForForm(String id) { + if (StringUtils.isEmpty(id)) { + return AjaxResult.returnFail("分娩ID不能为空"); + } + ChildbirthInfoVo vo = birthService.selectChildbirthVo(id); + ChildbirthAddRequestWrapper wrapper = new ChildbirthAddRequestWrapper(vo); + ChildbirthAddRequest request = wrapper.getRequest(); + return AjaxResult.returnSuccess(request); + } + /** *
  • @Description:获取分娩页面的字典数据 *
  • @return @@ -105,7 +156,7 @@ public class ChildbirthController extends BaseController { data.put("getCosEnums", CosEnums.getList()); // getCfType 产妇情况 data.put("getCfType", CfEnums.getList()); - + // 字典常量======================================= // organizations 组织机构-模拟数据 TODO List> organizations = new ArrayList<>(); @@ -131,7 +182,7 @@ public class ChildbirthController extends BaseController { data.put("now", DateUtil.getyyyy_MM_dd(new Date())); return AjaxResult.returnSuccess(data); } - + /** *
  • @Description:保存分娩记录 *
  • @param cardNo @@ -148,22 +199,22 @@ public class ChildbirthController extends BaseController { /* * 验证 */ - //验证-一个产程只能分娩一次 TODO - //验证-孕妇需要满?孕周才可以分娩 TODO + // 验证-一个产程只能分娩一次 TODO + // 验证-孕妇需要满?孕周才可以分娩 TODO /* * 保存分娩(包括分娩信息、胎儿、胎盘、新生儿) */ ChildbirthAddRequestWrapper wrapper = new ChildbirthAddRequestWrapper(request); ChildbirthInfoVo vo = wrapper.getVo(); - if(request.getId()==null){//新增 + if (request.getId() == null) {// 新增 birthService.createChildbirthVo(vo); - }else{//修改 + } else {// 修改 birthService.updateChildbirthVo(vo); } return AjaxResult.returnFail(); } - + /** *
  • @Description:依据cardNo或vcCardNo查询孕妇分娩记录 *
  • @param cardNo @@ -192,15 +243,15 @@ public class ChildbirthController extends BaseController { if (dataMap == null) { return AjaxResult.returnSuccess(null);// 将基本的对象返回空 } - WomanFetationRecord dbFetationRecord = (WomanFetationRecord)dataMap.get("dbFetationRecord"); - - //TODO 满固定孕周才可以分娩 - - // 分娩记录列表 + WomanFetationRecord dbFetationRecord = (WomanFetationRecord) dataMap.get("dbFetationRecord"); + + // TODO 满固定孕周才可以分娩 + + // 分娩记录列表 List> data = new ArrayList<>(); // data 系前端指定名称 List birthList = birthService.selectListByWomanId(dbFetationRecord.getId()); - if(birthList!=null && !birthList.isEmpty()){ - for(ChildbirthInfo info : birthList){ + if (birthList != null && !birthList.isEmpty()) { + for (ChildbirthInfo info : birthList) { Map map = new HashMap<>(); map.put("hospitalName", orgService.getNameById(info.getOrgId())); map.put("hospitalId", info.getOrgId()); @@ -211,12 +262,24 @@ public class ChildbirthController extends BaseController { } } - dataMap.put("data", data);//分娩记录列表 + /* + * 应前端魏增辉要求,增加以下字段 + */ + dataMap.put("dueType", "0");//是否需要补录分娩,为"1"时需要补录 TODO + if(birthList==null || birthList.isEmpty()){ + dataMap.put("isGravida", "1");//是否是孕妇 "1"孕妇 "0"产妇 + dataMap.put("dueDate", "");//分娩日期,当分娩后有该字段 + }else{ + dataMap.put("isGravida", "0");//是否是孕妇 "1"孕妇 "0"产妇 + + dataMap.put("dueDate", "");//分娩日期,当分娩后有该字段 + } + dataMap.put("status", "1");//? TODO + dataMap.put("type", "3");//? TODO + + dataMap.put("data", data);// 分娩记录列表 dataMap.remove("dbFetationRecord"); return AjaxResult.returnSuccess(dataMap); } - - - } diff --git a/parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java b/parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java index 99a9e4d..8bf3c19 100644 --- a/parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java +++ b/parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java @@ -1,9 +1,12 @@ package com.lyms.hospital.request.exam; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; +import org.springframework.util.StringUtils; + import com.lyms.hospital.entity.childbirth.ChildbirthInfo; import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo; import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; @@ -75,7 +78,7 @@ public class ChildbirthAddRequestWrapper extends OldNewWrapper { info.setProcessTotal(this.getProcessStr(totalprocess)); // 会阴情况:1完整,2切开 String perinealCondition = req.getPerinealCondition(); - if ("whole".equals(perinealCondition)) { + if ("full".equals(perinealCondition)) { info.setPerineumSituation(ChildbirthInfo.PERINEUM_SITUATION_WHOLE); } else if ("split".equals(perinealCondition)) { info.setPerineumSituation(ChildbirthInfo.PERINEUM_SITUATION_SPLIT); @@ -98,29 +101,29 @@ public class ChildbirthAddRequestWrapper extends OldNewWrapper { info.setLoseBloodReason(OldNewWrapper.obj2Int(loseBloodCause.get("select"))); info.setLoseBloodOtherText(OldNewWrapper.obj2Str(loseBloodCause.get("other"))); } - // 产科并发症 + // 产科并发症 Map ocs = (Map) req.getOcs(); - if(ocs!=null && !ocs.isEmpty()){ - if("yes".equals(ocs.get("yesOrNo"))){//有产科并发症(12个字段) - info.setComplicationQztp(obj2Bool2Int(ocs.get("qztp")));//前置胎盘 - info.setComplicationTpzb(obj2Bool2Int(ocs.get("tpzb")));//胎盘早剥 - info.setComplicationTpzl(obj2Bool2Int(ocs.get("tpzl")));//胎盘滞留 - info.setComplicationTmzp(obj2Bool2Int(ocs.get("tmzp")));//胎膜早破 - info.setComplicationChcx(obj2Bool2Int(ocs.get("chcx")));//产后出血 - info.setComplicationRsqgxy(obj2Bool2Int(ocs.get("rsqgxy")));//妊娠期高血压 - info.setComplicationZxa(obj2Bool2Int(ocs.get("zxqqq")));//子痫前期(轻) - info.setComplicationZxb(obj2Bool2Int(ocs.get("zxqqz")));//子痫前期(重) - info.setComplicationZxc(obj2Bool2Int(ocs.get("zxmxgxybfzxqq")));//子痫慢性高血压并发子痫前期 - info.setComplicationRshbmxgxy(obj2Bool2Int(ocs.get("rshbmxgxy")));//妊娠合并慢性高血压 - info.setComplicationOther(obj2Bool2Int(ocs.get("qt")));//其他(产科并发症) - info.setComplicationOtherText(OldNewWrapper.obj2Str(ocs.get("qtText")));//其他并发症文本 + if (ocs != null && !ocs.isEmpty()) { + if ("yes".equals(ocs.get("yesOrNo"))) {// 有产科并发症(12个字段) + info.setComplicationQztp(obj2Bool2Int(ocs.get("qztp")));// 前置胎盘 + info.setComplicationTpzb(obj2Bool2Int(ocs.get("tpzb")));// 胎盘早剥 + info.setComplicationTpzl(obj2Bool2Int(ocs.get("tpzl")));// 胎盘滞留 + info.setComplicationTmzp(obj2Bool2Int(ocs.get("tmzp")));// 胎膜早破 + info.setComplicationChcx(obj2Bool2Int(ocs.get("chcx")));// 产后出血 + info.setComplicationRsqgxy(obj2Bool2Int(ocs.get("rsqgxy")));// 妊娠期高血压 + info.setComplicationZxa(obj2Bool2Int(ocs.get("zxqqq")));// 子痫前期(轻) + info.setComplicationZxb(obj2Bool2Int(ocs.get("zxqqz")));// 子痫前期(重) + info.setComplicationZxc(obj2Bool2Int(ocs.get("zxmxgxybfzxqq")));// 子痫慢性高血压并发子痫前期 + info.setComplicationRshbmxgxy(obj2Bool2Int(ocs.get("rshbmxgxy")));// 妊娠合并慢性高血压 + info.setComplicationOther(obj2Bool2Int(ocs.get("qt")));// 其他(产科并发症) + info.setComplicationOtherText(OldNewWrapper.obj2Str(ocs.get("qtText")));// 其他并发症文本 } } // 胎儿列表 - List> placentas = req.getPlacentas(); - if(placentas!=null && !placentas.isEmpty()){ - for(Map map : placentas){ + List> placentas = req.getPlacentas(); + if (placentas != null && !placentas.isEmpty()) { + for (Map map : placentas) { ChildbirthTai tai = new ChildbirthTai(); tai.setHeartRate(OldNewWrapper.obj2Int(map.get("heartRate"))); tai.setFirstExpose(OldNewWrapper.obj2Int(map.get("fetalPresentation"))); @@ -128,63 +131,63 @@ public class ChildbirthAddRequestWrapper extends OldNewWrapper { taiList.add(tai); } } - + // 胎盘娩出方式 - List> extPlacentas = req.getExtPlacentas(); - if(extPlacentas!=null && !extPlacentas.isEmpty()){ - for(Map placenta : extPlacentas){ + List> extPlacentas = req.getExtPlacentas(); + if (extPlacentas != null && !extPlacentas.isEmpty()) { + for (Map placenta : extPlacentas) { ChildbirthTaipan taipan = new ChildbirthTaipan(); taipan.setPlacentaBirthType(OldNewWrapper.obj2Int(placenta.get("tpmcType"))); - if("muMian".equals(placenta.get("mcType"))){ - taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_MUM);//母面 - }else{ - taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_SON);//子面 + if ("muMian".equals(placenta.get("mcType"))) { + taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_MUM);// 母面 + } else { + taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_SON);// 子面 } Map tpSize = (Map) placenta.get("tpSize"); - if(tpSize!=null){ + if (tpSize != null) { taipan.setPlacentaLength(OldNewWrapper.obj2Int(tpSize.get("c"))); taipan.setPlacentaWidth(OldNewWrapper.obj2Int(tpSize.get("k"))); taipan.setPlacentaThick(OldNewWrapper.obj2Int(tpSize.get("g"))); } taipan.setPlacentaWeight(OldNewWrapper.obj2Int(placenta.get("tpWeight"))); taipan.setUmbilicalLength(OldNewWrapper.obj2Int(placenta.get("umbilicalCordLength"))); - if("yes".equals(placenta.get("umbilicalCordEx"))){//脐带有异常 + if ("yes".equals(placenta.get("umbilicalCordEx"))) {// 脐带有异常 taipan.setUmbilicalException(OldNewWrapper.obj2Int(placenta.get("umbilicalCordExType"))); - }else{ + } else { taipan.setUmbilicalException(0); } taipanList.add(taipan); - } + } } - + // 新生儿 - List> babies = req.getBabies(); - if(babies!=null && !babies.isEmpty()){ - for(Map baby : babies){ + List> babies = req.getBabies(); + if (babies != null && !babies.isEmpty()) { + for (Map baby : babies) { ChildbirthNewborn newborn = new ChildbirthNewborn(); - newborn.setGender(OldNewWrapper.obj2Int(baby.get("babyGender")));//性别 - newborn.setWeight(OldNewWrapper.obj2Int(baby.get("babyWeight")));//体重 - newborn.setHeight(OldNewWrapper.obj2Int(baby.get("babyHeight")));//身长 - newborn.setDeformity(OldNewWrapper.obj2Int(baby.get("deformity")));//是否畸形 - - Map apgarScore = (Map)baby.get("apgarScore"); - if(apgarScore!=null && !apgarScore.isEmpty()){ - newborn.setApgarScoreOne(OldNewWrapper.obj2Int(baby.get("pf1")));//apgar评分1分钟 - newborn.setApgarScoreFive(OldNewWrapper.obj2Int(baby.get("pf5")));//apgar评分5分钟 - newborn.setApgarScoreTen(OldNewWrapper.obj2Int(baby.get("pf10")));//apgar评分10分钟 + newborn.setGender(OldNewWrapper.obj2Int(baby.get("babyGender")));// 性别 + newborn.setWeight(OldNewWrapper.obj2Int(baby.get("babyWeight")));// 体重 + newborn.setHeight(OldNewWrapper.obj2Int(baby.get("babyHeight")));// 身长 + newborn.setDeformity(OldNewWrapper.obj2Int(baby.get("deformity")));// 是否畸形 + + Map apgarScore = (Map) baby.get("apgarScore"); + if (apgarScore != null && !apgarScore.isEmpty()) { + newborn.setApgarScoreOne(OldNewWrapper.obj2Int(baby.get("pf1")));// apgar评分1分钟 + newborn.setApgarScoreFive(OldNewWrapper.obj2Int(baby.get("pf5")));// apgar评分5分钟 + newborn.setApgarScoreTen(OldNewWrapper.obj2Int(baby.get("pf10")));// apgar评分10分钟 } - - newborn.setAsphyxia(OldNewWrapper.obj2Int(baby.get("asphyxiaM")));//窒息分钟 - newborn.setGestationEnding(OldNewWrapper.obj2Int(baby.get("pregnancyOut")));//妊娠结局(枚举) - newborn.setDisease(OldNewWrapper.obj2Str(baby.get("babyHealthy")));//新生儿疾病 - newborn.setTouchBegin(OldNewWrapper.obj2Int(baby.get("contactStartM")));//母婴接触开始时间 - newborn.setTouchStay(OldNewWrapper.obj2Int(baby.get("contactM")));//母婴接触持续时间 - if("yes".equals(OldNewWrapper.obj2Str(baby.get("earlySuck")))){ - newborn.setSuck(1);//早吸吮(枚举)1是,0否 - }else{ - newborn.setSuck(0);//早吸吮(枚举)1是,0否 + + newborn.setAsphyxia(OldNewWrapper.obj2Int(baby.get("asphyxiaM")));// 窒息分钟 + newborn.setGestationEnding(OldNewWrapper.obj2Int(baby.get("pregnancyOut")));// 妊娠结局(枚举) + newborn.setDisease(OldNewWrapper.obj2Str(baby.get("babyHealthy")));// 新生儿疾病 + newborn.setTouchBegin(OldNewWrapper.obj2Int(baby.get("contactStartM")));// 母婴接触开始时间 + newborn.setTouchStay(OldNewWrapper.obj2Int(baby.get("contactM")));// 母婴接触持续时间 + if ("yes".equals(OldNewWrapper.obj2Str(baby.get("earlySuck")))) { + newborn.setSuck(1);// 早吸吮(枚举)1是,0否 + } else { + newborn.setSuck(0);// 早吸吮(枚举)1是,0否 } - newborn.setBirthTime(DateUtil.parseYMDHM(OldNewWrapper.obj2Str(baby.get("dueTime"))));//娩出时间 + newborn.setBirthTime(DateUtil.parseYMDHM(OldNewWrapper.obj2Str(baby.get("dueTime"))));// 娩出时间 newbornList.add(newborn); } } @@ -192,10 +195,225 @@ public class ChildbirthAddRequestWrapper extends OldNewWrapper { vo.setNewbornList(newbornList); vo.setTaiList(taiList); vo.setTaipanList(taipanList); - }//if (req != null) + } // if (req != null) + + } + + public ChildbirthAddRequestWrapper(ChildbirthInfoVo vo) { + if (vo == null || vo.getInfo() == null) { + return; + } + this.vo = vo; + this.info = vo.getInfo(); + this.newbornList = vo.getNewbornList(); + this.taiList = vo.getTaiList(); + this.taipanList = vo.getTaipanList(); + /* + * 快速映射普通字段 + */ + // { 分娩ID、居民ID、孕妇ID、分娩孕周、胎儿数、胎盘数 } + // { (剖宫产)手术原因、 会阴撕裂、缝线针数、产妇情况、造成死亡的原因 } + // { 呼吸、脉搏、产后1小时失血量、产后2小时失血量、产后24小时失血量、第三产程+产后2小时失血量 } + // { 其他失血原因文本、 分娩医院、接生医生} + String[] req_map = { "id", "pid", "parentId", "dueWeek", "tireNumber", "placenta", "operationCause", + "siLielevel", "needleNum", "maternalInfo", "deathCause", "breath", "pulse", "oHloseBloodL", + "tHloseBloodL", "rHloseBloodL", "sHloseBloodL", "deathCauseText", "fmHospital", "deliverDoctor" }; + String[] info_map = { "id", "personId", "womanId", "childbirthTimeText", "fetusNum", "placentaNum", + "operationReason", "perineumSplit", "needleNum", "womanSituation", "otherDeathReasonText", "breath", + "pulse", "loseBloodA", "loseBloodB", "loseBloodC", "loseBloodD", "loseBloodOtherText", "orgId", + "doctorId" }; + Map reqMap = XjhMapUtil.transBean2AliasMap(this.info, XjhMapUtil.getKeyMap(req_map, info_map)); + if (reqMap != null) { + this.request = (ChildbirthAddRequest) XjhMapUtil.transMap2Bean(reqMap, this.request); + } + /* + * 特殊字段处理 + */ + // 胎儿 placentas + List> placentas = new ArrayList<>(); + if (taiList != null && !taiList.isEmpty()) { + for (ChildbirthTai tai : taiList) { + Map map = new HashMap<>(); + map.put("heartRate", tai.getHeartRate()); + map.put("fetalPosition", tai.getPosition().toString()); + map.put("fetalPresentation", tai.getFirstExpose().toString()); + placentas.add(map); + } + } + this.request.setPlacentas(placentas); + + // 分娩方式 deliveryMode + Map deliveryMode = new HashMap<>(); + Integer childbirthType = info.getChildbirthType(); + if (childbirthType.equals(1)) {// 剖宫产 + deliveryMode.put("fmfs", "1"); + } else {// 顺产 + deliveryMode.put("fmfs", "0"); + deliveryMode.put("scfs", childbirthType.toString()); + } + this.request.setDeliveryMode(deliveryMode); + + // 产程时间 prodprocess + Map prodprocess = new HashMap<>(); + prodprocess.put("one", getProcessMap(info.getProcessFirst())); + prodprocess.put("two", getProcessMap(info.getProcessSecond())); + prodprocess.put("three", getProcessMap(info.getProcessThird())); + this.request.setProdprocess(prodprocess); + + // 总产程时间 totalprocess + this.request.setTotalprocess(getProcessMap(info.getProcessTotal())); + + // 会阴情况:1完整,2切开 + if (info.getPerineumSituation() != null) { + if (info.getPerineumSituation() == ChildbirthInfo.PERINEUM_SITUATION_SPLIT) { + this.request.setPerinealCondition("split"); + } else { + this.request.setPerinealCondition("full"); + } + } + + // chBp 产后血压 + Map chBp = new HashMap<>(); + chBp.put("szy", info.getBloodDiastole()); + chBp.put("ssy", info.getBloodShrink()); + this.request.setChBp(chBp); + + // ch2Bp 产后两小时血压 + Map ch2Bp = new HashMap<>(); + ch2Bp.put("szy", info.getBloodDiastoleLater()); + ch2Bp.put("ssy", info.getBloodShrinkLater()); + this.request.setChBp(ch2Bp); + + // loseBloodCause 其他失血原因文本 + Map loseBloodCause = new HashMap<>(); + if (!StringUtils.isEmpty(info.getLoseBloodOtherText())) { + loseBloodCause.put("select", "1"); + loseBloodCause.put("other", info.getLoseBloodOtherText()); + } else { + loseBloodCause.put("select", "0"); + loseBloodCause.put("other", ""); + } + this.request.setLoseBloodCause(loseBloodCause); + + // ocs + Map ocs = new HashMap<>(); + String yesOrNo = "no"; + if (int2Bool(info.getComplicationQztp())) {// 前置胎盘 + yesOrNo = "yes"; + ocs.put("qztp", true); + } + if (int2Bool(info.getComplicationTpzb())) {// 胎盘早剥 + yesOrNo = "yes"; + ocs.put("tpzb", true); + } + if (int2Bool(info.getComplicationTpzl())) {// 胎盘滞留 + yesOrNo = "yes"; + ocs.put("tpzl", true); + } + if (int2Bool(info.getComplicationTmzp())) {// 胎膜早破 + yesOrNo = "yes"; + ocs.put("tmzp", true); + } + if (int2Bool(info.getComplicationChcx())) {// 产后出血 + yesOrNo = "yes"; + ocs.put("chcx", true); + } + if (int2Bool(info.getComplicationRsqgxy())) {// 妊娠期高血压 + yesOrNo = "yes"; + ocs.put("rsqgxy", true); + } + if (int2Bool(info.getComplicationZxa())) {// 子痫前期(轻) + yesOrNo = "yes"; + ocs.put("zxqqq", true); + } + if (int2Bool(info.getComplicationZxb())) {// 子痫前期(重) + yesOrNo = "yes"; + ocs.put("zxqqz", true); + } + if (int2Bool(info.getComplicationZxc())) {// 子痫慢性高血压并发子痫前期 + yesOrNo = "yes"; + ocs.put("zxmxgxybfzxqq", true); + } + if (int2Bool(info.getComplicationRshbmxgxy())) {// 妊娠合并慢性高血压 + yesOrNo = "yes"; + ocs.put("rshbmxgxy", true); + } + if (int2Bool(info.getComplicationOther())) {// 其他(产科并发症) + yesOrNo = "yes"; + ocs.put("qt", true); + } + ocs.put("qtText", info.getComplicationOtherText()); + ocs.put("yesOrNo", yesOrNo); + this.request.setOcs(ocs); + + // extPlacentas 胎盘 + List> extPlacentas = new ArrayList<>(); + if (taipanList != null && !taipanList.isEmpty()) { + for (ChildbirthTaipan taipan : taipanList) { + Map map = new HashMap<>(); + + map.put("tpmcType", taipan.getPlacentaBirthType()); + if (taipan.getBirthType().intValue() == ChildbirthTaipan.BIRTH_TYPE_MUM) { + map.put("mcType", "muMian"); + } else if (taipan.getBirthType().intValue() == ChildbirthTaipan.BIRTH_TYPE_SON) { + map.put("mcType", "ziMian"); + } + Map tpSize = new HashMap<>(); + tpSize.put("c", taipan.getPlacentaLength()); + tpSize.put("k", taipan.getPlacentaWidth()); + tpSize.put("g", taipan.getPlacentaThick()); + map.put("tpSize", tpSize); + map.put("tpWeight", taipan.getPlacentaWeight()); + map.put("umbilicalCordLength", taipan.getUmbilicalLength()); + if (taipan.getUmbilicalException() != null) { + if (taipan.getUmbilicalException().intValue() != 0) { + map.put("umbilicalCordEx", "yes"); + map.put("umbilicalCordExType", taipan.getUmbilicalException()); + } + } + extPlacentas.add(map); + } + } + this.request.setExtPlacentas(extPlacentas); + + // babies 新生儿列表 + List> babies = new ArrayList<>(); + if (newbornList != null && !newbornList.isEmpty()) { + for (ChildbirthNewborn newborn : newbornList) { + Map map = new HashMap<>(); + map.put("id", newborn.getId()); + map.put("babyGender", newborn.getGender().toString()); + map.put("babyWeight", newborn.getWeight().toString()); + map.put("babyHeight", newborn.getHeight().toString()); + map.put("deformity", newborn.getDeformity()); + Map apgarScore = new HashMap<>(); + apgarScore.put("pf1", newborn.getApgarScoreOne()); + apgarScore.put("pf5", newborn.getApgarScoreFive()); + apgarScore.put("pf10", newborn.getApgarScoreTen()); + map.put("apgarScore", apgarScore); + + map.put("asphyxiaM", newborn.getAsphyxia()); + map.put("pregnancyOut", newborn.getGestationEnding().toString()); + map.put("babyHealthy", newborn.getDisease()); + map.put("contactStartM", newborn.getTouchBegin()); + map.put("contactM", newborn.getTouchStay()); + if (newborn.getSuck() != null) { + if (newborn.getSuck() == 1) { + map.put("earlySuck", "yes"); + } else { + map.put("earlySuck", "no"); + } + } + map.put("dueTime", DateUtil.getyyyy_MM_dd_hms(newborn.getBirthTime())); + babies.add(map); + } + } + this.request.setBabies(babies); } + // ===================================================================================== + private String getProcessStr(Map map) { String str = ""; if (map != null && !map.isEmpty()) { @@ -205,12 +423,37 @@ public class ChildbirthAddRequestWrapper extends OldNewWrapper { } return str; } - - private int obj2Bool2Int(Object obj){ + + private Map getProcessMap(String str) { + if (StringUtils.isEmpty(str)) { + return null; + } + String[] strs = str.split("-"); + if (strs == null || strs.length != 2) { + return null; + } + Map map = new HashMap<>(); + map.put("h", Integer.parseInt(strs[0])); + map.put("m", Integer.parseInt(strs[1])); + return map; + } + + private int obj2Bool2Int(Object obj) { Boolean bool = OldNewWrapper.obj2Bool(obj); return OldNewWrapper.bool2Int(bool); } + private boolean int2Bool(Integer intObj) { + if (intObj == null) { + return false; + } + if (intObj.equals(1)) { + return true; + } else { + return false; + } + } + public ChildbirthAddRequest getRequest() { return request; }