Commit cc841104c6e557d973e5695a027ebc478e90328a

Authored by xujiahong
1 parent 824d9e9795
Exists in master

日常提交-分娩保存、查询表单、查询医院

Showing 9 changed files with 467 additions and 105 deletions

parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java View file @ cc84110
1 1 package com.lyms.base.common.service.organ;
2 2  
3 3 import java.io.Serializable;
  4 +import java.util.List;
4 5  
5 6 import com.baomidou.mybatisplus.plugins.Page;
6 7 import com.lyms.base.common.entity.organ.Organizations;
... ... @@ -83,6 +84,17 @@
83 84 * <li>修改时间:
84 85 */
85 86 public String getNameById(String id);
  87 +
  88 + /**
  89 + * <li>@Description:通过名称模糊查询医院列表
  90 + * <li>@param name
  91 + * <li>@return
  92 + * <li>创建人:xujiahong
  93 + * <li>创建时间:2017年5月15日
  94 + * <li>修改人:
  95 + * <li>修改时间:
  96 + */
  97 + public List<Organizations> selectListByName(String name);
86 98  
87 99 }
parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java View file @ cc84110
1 1 package com.lyms.base.common.service.organ.impl;
2 2  
3 3 import java.io.Serializable;
  4 +import java.util.List;
4 5  
5 6 import org.springframework.beans.factory.annotation.Autowired;
6 7 import org.springframework.stereotype.Service;
7 8 import org.springframework.transaction.annotation.Transactional;
  9 +import org.springframework.util.StringUtils;
8 10  
  11 +import com.baomidou.mybatisplus.mapper.EntityWrapper;
9 12 import com.baomidou.mybatisplus.plugins.Page;
10 13 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
11 14 import com.lyms.base.common.dao.organ.OrganizationsMapper;
... ... @@ -82,6 +85,17 @@
82 85 public String getNameById(String id) {
83 86 Organizations org = this.selectById(id);
84 87 return org==null?null:org.getName();
  88 + }
  89 +
  90 + @Override
  91 + public List<Organizations> selectListByName(String name) {
  92 + if(StringUtils.isEmpty(name)){
  93 + return null;
  94 + }
  95 + EntityWrapper<Organizations> ew = new EntityWrapper<Organizations>();
  96 + ew.where("1=1");
  97 + ew.like("NAME", name);
  98 + return this.selectList(ew);
85 99 }
86 100  
87 101 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java View file @ cc84110
... ... @@ -71,8 +71,8 @@
71 71 @Override
72 72 public List<ChildbirthNewborn> listByCid(String cid) {
73 73 EntityWrapper<ChildbirthNewborn> wrapper = new EntityWrapper<ChildbirthNewborn>();
74   - wrapper.eq("CID", cid);
75   - wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目
  74 + wrapper.where("CID={0}", cid);
  75 + wrapper.and("IF_DEL={0}", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目
76 76 return baseMapper.selectList(wrapper);
77 77 }
78 78  
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java View file @ cc84110
... ... @@ -49,8 +49,8 @@
49 49 @Override
50 50 public List<ChildbirthTai> listByCid(String cid) {
51 51 EntityWrapper<ChildbirthTai> wrapper = new EntityWrapper<>();
52   - wrapper.eq("CID", cid);
53   - wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目
  52 + wrapper.where("CID={0}", cid);
  53 + wrapper.and("IF_DEL={0}", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目
54 54 return baseMapper.selectList(wrapper);
55 55 }
56 56  
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java View file @ cc84110
... ... @@ -49,8 +49,8 @@
49 49 @Override
50 50 public List<ChildbirthTaipan> listByCid(String cid) {
51 51 EntityWrapper<ChildbirthTaipan> wrapper = new EntityWrapper<>();
52   - wrapper.eq("CID", cid);
53   - wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目
  52 + wrapper.where("CID={0}", cid);
  53 + wrapper.and("IF_DEL={0}", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目
54 54 return baseMapper.selectList(wrapper);
55 55 }
56 56  
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java View file @ cc84110
... ... @@ -323,21 +323,21 @@
323 323 // 高危因素列表
324 324 BigDecimal riskScore = new BigDecimal(0);
325 325 List riskFactor = new ArrayList();
326   -// List<HighriskConf> highriskConfList = diagnoseInfoService.getLastHighrisk(dbFetationRecord.getWomanPersonId());
327   -// if(highriskConfList!=null && !highriskConfList.isEmpty()){
328   -// for(HighriskConf hc : highriskConfList){
329   -// Map<String,Object> map = new HashMap<>();
330   -// map.put("id", hc.getId());
331   -// map.put("name", hc.getName());
332   -// map.put("color", hc.getColortext());
333   -// map.put("code", hc.getColorcode());
334   -// riskFactor.add(map);
335   -// if(hc.getGrade()!=null){
336   -// BigDecimal big = new BigDecimal(hc.getGrade());
337   -// riskScore = riskScore.add(big);
338   -// }
339   -// }
340   -// }
  326 + List<HighriskConf> highriskConfList = diagnoseInfoService.getLastHighrisk(dbFetationRecord.getWomanPersonId());
  327 + if(highriskConfList!=null && !highriskConfList.isEmpty()){
  328 + for(HighriskConf hc : highriskConfList){
  329 + Map<String,Object> map = new HashMap<>();
  330 + map.put("id", hc.getId());
  331 + map.put("name", hc.getName());
  332 + map.put("color", hc.getColortext());
  333 + map.put("code", hc.getColorcode());
  334 + riskFactor.add(map);
  335 + if(hc.getGrade()!=null){
  336 + BigDecimal big = new BigDecimal(hc.getGrade());
  337 + riskScore = riskScore.add(big);
  338 + }
  339 + }
  340 + }
341 341 dataMap.put("riskFactor", riskFactor);//高危因素列表
342 342 dataMap.put("riskScore", riskScore.toString());// 高危评分
343 343  
parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java View file @ cc84110
... ... @@ -12,7 +12,9 @@
12 12 import org.springframework.web.bind.annotation.RequestMethod;
13 13 import org.springframework.web.bind.annotation.ResponseBody;
14 14  
  15 +import com.lyms.base.common.entity.organ.Organizations;
15 16 import com.lyms.base.common.entity.region.Regions;
  17 +import com.lyms.base.common.service.organ.OrganizationsService;
16 18 import com.lyms.base.common.service.region.RegionsService;
17 19 import com.lyms.hospital.entity.history.HistorySource;
18 20 import com.lyms.hospital.enums.business.ServiceStatusEnums;
19 21  
... ... @@ -27,10 +29,11 @@
27 29 * 公用接口-前端控制器
28 30 * </p>
29 31 *
30   - * []查询病史配置<br>
31   - * 查询省市区数据<br>
32   - * 查询字典数据<br>
  32 + * []查询病史配置<br/>
  33 + * 查询省市区数据<br/>
  34 + * 查询字典数据<br/>
33 35 * []获取当前服务器时间<br/>
  36 + * []获取医院数据<br/>
34 37 *
35 38 * @author xujiahong
36 39 * @since 2017-04-21
... ... @@ -43,6 +46,33 @@
43 46 private RegionsService regionService;
44 47 @Autowired
45 48 private HistorySourceService historySourceService;
  49 + @Autowired
  50 + private OrganizationsService orgService;
  51 +
  52 + /**
  53 + * <li>@Description:获取医院数据
  54 + * <li>@param name
  55 + * <li>@return
  56 + * <li>创建人:xujiahong
  57 + * <li>创建时间:2017年5月15日
  58 + * <li>修改人:
  59 + * <li>修改时间:
  60 + */
  61 + @RequestMapping(value = "/queryHospitals", method = RequestMethod.GET)
  62 + @ResponseBody
  63 + public AjaxResult queryHospital(String name) {
  64 + List<Organizations> list = orgService.selectListByName(name);
  65 + List<Map<String,Object>> dataList = new ArrayList<>();
  66 + if(list!=null && !list.isEmpty()){
  67 + for(Organizations org : list){
  68 + Map<String,Object> map = new HashMap<>();
  69 + map.put("id", org.getId());
  70 + map.put("name", org.getName());
  71 + dataList.add(map);
  72 + }
  73 + }
  74 + return AjaxResult.returnSuccess(dataList);
  75 + }
46 76  
47 77 /**
48 78 * <li>@Description:获取当前服务器时间
parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java View file @ cc84110
... ... @@ -17,6 +17,9 @@
17 17 import com.lyms.base.common.service.organ.OrganizationsService;
18 18 import com.lyms.hospital.entity.childbirth.ChildbirthInfo;
19 19 import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo;
  20 +import com.lyms.hospital.entity.childbirth.ChildbirthNewborn;
  21 +import com.lyms.hospital.entity.childbirth.ChildbirthTai;
  22 +import com.lyms.hospital.entity.childbirth.ChildbirthTaipan;
20 23 import com.lyms.hospital.entity.woman.WomanFetationRecord;
21 24 import com.lyms.hospital.enums.business.CfEnums;
22 25 import com.lyms.hospital.enums.business.CosEnums;
23 26  
24 27  
25 28  
26 29  
... ... @@ -47,25 +50,73 @@
47 50 * []获取分娩页面的字典数据<br/>
48 51 * [--]保存分娩记录<br/>
49 52 * []依据cardNo或vcCardNo查询孕妇分娩记录<br/>
50   - * 查看表单<br/>
  53 + * []查看表单<br/>
51 54 * 查看页面<br/>
52 55 * 删除分娩信息<br/>
53 56 *
54   - * @author xujiahong
  57 + * @author xujiahong
55 58 * @since 2017-03-31
56 59 */
57 60 @Controller
58 61 @RequestMapping("/childbirth")
59 62 public class ChildbirthController extends BaseController {
60   -
  63 +
61 64 @Autowired
62 65 private WomanFetationRecordService fetationService;
63 66 @Autowired
64 67 private ChildbirthInfoService birthService;
65 68 @Autowired
66 69 private OrganizationsService orgService;
67   -
  70 +
68 71 /**
  72 + * <li>@Description:查看分娩页面
  73 + * <li>@param id
  74 + * <li>@return
  75 + * <li>创建人:xujiahong
  76 + * <li>创建时间:2017年5月15日
  77 + * <li>修改人:
  78 + * <li>修改时间:
  79 + */
  80 + @RequestMapping(value = "/findMatDeliverData", method = RequestMethod.GET)
  81 + @ResponseBody
  82 + public AjaxResult getDetailForPage(String id) {
  83 + if (StringUtils.isEmpty(id)) {
  84 + return AjaxResult.returnFail("分娩ID不能为空");
  85 + }
  86 + ChildbirthInfoVo vo = birthService.selectChildbirthVo(id);
  87 + if (vo == null || vo.getInfo() == null) {// 未找到分娩记录
  88 + return AjaxResult.returnSuccess();
  89 + }
  90 + ChildbirthInfo info = vo.getInfo();
  91 + List<ChildbirthNewborn> newbornList = vo.getNewbornList();
  92 + List<ChildbirthTaipan> taipanList = vo.getTaipanList();
  93 + List<ChildbirthTai> taiList = vo.getTaiList();
  94 +
  95 + return AjaxResult.returnFail();
  96 + }
  97 +
  98 + /**
  99 + * <li>@Description:查看分娩表单
  100 + * <li>@param id
  101 + * <li>@return
  102 + * <li>创建人:xujiahong
  103 + * <li>创建时间:2017年5月15日
  104 + * <li>修改人:
  105 + * <li>修改时间:
  106 + */
  107 + @RequestMapping(value = "/matdel", method = RequestMethod.GET)
  108 + @ResponseBody
  109 + public AjaxResult getDetailForForm(String id) {
  110 + if (StringUtils.isEmpty(id)) {
  111 + return AjaxResult.returnFail("分娩ID不能为空");
  112 + }
  113 + ChildbirthInfoVo vo = birthService.selectChildbirthVo(id);
  114 + ChildbirthAddRequestWrapper wrapper = new ChildbirthAddRequestWrapper(vo);
  115 + ChildbirthAddRequest request = wrapper.getRequest();
  116 + return AjaxResult.returnSuccess(request);
  117 + }
  118 +
  119 + /**
69 120 * <li>@Description:获取分娩页面的字典数据
70 121 * <li>@return
71 122 * <li>创建人:xujiahong
... ... @@ -105,7 +156,7 @@
105 156 data.put("getCosEnums", CosEnums.getList());
106 157 // getCfType 产妇情况
107 158 data.put("getCfType", CfEnums.getList());
108   -
  159 +
109 160 // 字典常量=======================================
110 161 // organizations 组织机构-模拟数据 TODO
111 162 List<Map<String, Object>> organizations = new ArrayList<>();
... ... @@ -131,7 +182,7 @@
131 182 data.put("now", DateUtil.getyyyy_MM_dd(new Date()));
132 183 return AjaxResult.returnSuccess(data);
133 184 }
134   -
  185 +
135 186 /**
136 187 * <li>@Description:保存分娩记录
137 188 * <li>@param cardNo
138 189  
139 190  
140 191  
... ... @@ -148,22 +199,22 @@
148 199 /*
149 200 * 验证
150 201 */
151   - //验证-一个产程只能分娩一次 TODO
152   - //验证-孕妇需要满?孕周才可以分娩 TODO
  202 + // 验证-一个产程只能分娩一次 TODO
  203 + // 验证-孕妇需要满?孕周才可以分娩 TODO
153 204  
154 205 /*
155 206 * 保存分娩(包括分娩信息、胎儿、胎盘、新生儿)
156 207 */
157 208 ChildbirthAddRequestWrapper wrapper = new ChildbirthAddRequestWrapper(request);
158 209 ChildbirthInfoVo vo = wrapper.getVo();
159   - if(request.getId()==null){//新增
  210 + if (request.getId() == null) {// 新增
160 211 birthService.createChildbirthVo(vo);
161   - }else{//修改
  212 + } else {// 修改
162 213 birthService.updateChildbirthVo(vo);
163 214 }
164 215 return AjaxResult.returnFail();
165 216 }
166   -
  217 +
167 218 /**
168 219 * <li>@Description:依据cardNo或vcCardNo查询孕妇分娩记录
169 220 * <li>@param cardNo
170 221  
... ... @@ -192,15 +243,15 @@
192 243 if (dataMap == null) {
193 244 return AjaxResult.returnSuccess(null);// 将基本的对象返回空
194 245 }
195   - WomanFetationRecord dbFetationRecord = (WomanFetationRecord)dataMap.get("dbFetationRecord");
196   -
197   - //TODO 满固定孕周才可以分娩
198   -
199   - // 分娩记录列表
  246 + WomanFetationRecord dbFetationRecord = (WomanFetationRecord) dataMap.get("dbFetationRecord");
  247 +
  248 + // TODO 满固定孕周才可以分娩
  249 +
  250 + // 分娩记录列表
200 251 List<Map<String, Object>> data = new ArrayList<>(); // data 系前端指定名称
201 252 List<ChildbirthInfo> birthList = birthService.selectListByWomanId(dbFetationRecord.getId());
202   - if(birthList!=null && !birthList.isEmpty()){
203   - for(ChildbirthInfo info : birthList){
  253 + if (birthList != null && !birthList.isEmpty()) {
  254 + for (ChildbirthInfo info : birthList) {
204 255 Map<String, Object> map = new HashMap<>();
205 256 map.put("hospitalName", orgService.getNameById(info.getOrgId()));
206 257 map.put("hospitalId", info.getOrgId());
207 258  
... ... @@ -211,13 +262,25 @@
211 262 }
212 263 }
213 264  
214   - dataMap.put("data", data);//分娩记录列表
  265 + /*
  266 + * 应前端魏增辉要求,增加以下字段
  267 + */
  268 + dataMap.put("dueType", "0");//是否需要补录分娩,为"1"时需要补录 TODO
  269 + if(birthList==null || birthList.isEmpty()){
  270 + dataMap.put("isGravida", "1");//是否是孕妇 "1"孕妇 "0"产妇
  271 + dataMap.put("dueDate", "");//分娩日期,当分娩后有该字段
  272 + }else{
  273 + dataMap.put("isGravida", "0");//是否是孕妇 "1"孕妇 "0"产妇
  274 +
  275 + dataMap.put("dueDate", "");//分娩日期,当分娩后有该字段
  276 + }
  277 + dataMap.put("status", "1");//? TODO
  278 + dataMap.put("type", "3");//? TODO
  279 +
  280 + dataMap.put("data", data);// 分娩记录列表
215 281 dataMap.remove("dbFetationRecord");
216 282 return AjaxResult.returnSuccess(dataMap);
217 283 }
218 284  
219   -
220   -
221   -
222 285 }
parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java View file @ cc84110
1 1 package com.lyms.hospital.request.exam;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.HashMap;
4 5 import java.util.List;
5 6 import java.util.Map;
6 7  
  8 +import org.springframework.util.StringUtils;
  9 +
7 10 import com.lyms.hospital.entity.childbirth.ChildbirthInfo;
8 11 import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo;
9 12 import com.lyms.hospital.entity.childbirth.ChildbirthNewborn;
... ... @@ -75,7 +78,7 @@
75 78 info.setProcessTotal(this.getProcessStr(totalprocess));
76 79 // 会阴情况:1完整,2切开
77 80 String perinealCondition = req.getPerinealCondition();
78   - if ("whole".equals(perinealCondition)) {
  81 + if ("full".equals(perinealCondition)) {
79 82 info.setPerineumSituation(ChildbirthInfo.PERINEUM_SITUATION_WHOLE);
80 83 } else if ("split".equals(perinealCondition)) {
81 84 info.setPerineumSituation(ChildbirthInfo.PERINEUM_SITUATION_SPLIT);
82 85  
83 86  
... ... @@ -98,29 +101,29 @@
98 101 info.setLoseBloodReason(OldNewWrapper.obj2Int(loseBloodCause.get("select")));
99 102 info.setLoseBloodOtherText(OldNewWrapper.obj2Str(loseBloodCause.get("other")));
100 103 }
101   - // 产科并发症
  104 + // 产科并发症
102 105 Map<String, Object> ocs = (Map<String, Object>) req.getOcs();
103   - if(ocs!=null && !ocs.isEmpty()){
104   - if("yes".equals(ocs.get("yesOrNo"))){//有产科并发症(12个字段)
105   - info.setComplicationQztp(obj2Bool2Int(ocs.get("qztp")));//前置胎盘
106   - info.setComplicationTpzb(obj2Bool2Int(ocs.get("tpzb")));//胎盘早剥
107   - info.setComplicationTpzl(obj2Bool2Int(ocs.get("tpzl")));//胎盘滞留
108   - info.setComplicationTmzp(obj2Bool2Int(ocs.get("tmzp")));//胎膜早破
109   - info.setComplicationChcx(obj2Bool2Int(ocs.get("chcx")));//产后出血
110   - info.setComplicationRsqgxy(obj2Bool2Int(ocs.get("rsqgxy")));//妊娠期高血压
111   - info.setComplicationZxa(obj2Bool2Int(ocs.get("zxqqq")));//子痫前期(轻)
112   - info.setComplicationZxb(obj2Bool2Int(ocs.get("zxqqz")));//子痫前期(重)
113   - info.setComplicationZxc(obj2Bool2Int(ocs.get("zxmxgxybfzxqq")));//子痫慢性高血压并发子痫前期
114   - info.setComplicationRshbmxgxy(obj2Bool2Int(ocs.get("rshbmxgxy")));//妊娠合并慢性高血压
115   - info.setComplicationOther(obj2Bool2Int(ocs.get("qt")));//其他(产科并发症)
116   - info.setComplicationOtherText(OldNewWrapper.obj2Str(ocs.get("qtText")));//其他并发症文本
  106 + if (ocs != null && !ocs.isEmpty()) {
  107 + if ("yes".equals(ocs.get("yesOrNo"))) {// 有产科并发症(12个字段)
  108 + info.setComplicationQztp(obj2Bool2Int(ocs.get("qztp")));// 前置胎盘
  109 + info.setComplicationTpzb(obj2Bool2Int(ocs.get("tpzb")));// 胎盘早剥
  110 + info.setComplicationTpzl(obj2Bool2Int(ocs.get("tpzl")));// 胎盘滞留
  111 + info.setComplicationTmzp(obj2Bool2Int(ocs.get("tmzp")));// 胎膜早破
  112 + info.setComplicationChcx(obj2Bool2Int(ocs.get("chcx")));// 产后出血
  113 + info.setComplicationRsqgxy(obj2Bool2Int(ocs.get("rsqgxy")));// 妊娠期高血压
  114 + info.setComplicationZxa(obj2Bool2Int(ocs.get("zxqqq")));// 子痫前期(轻)
  115 + info.setComplicationZxb(obj2Bool2Int(ocs.get("zxqqz")));// 子痫前期(重)
  116 + info.setComplicationZxc(obj2Bool2Int(ocs.get("zxmxgxybfzxqq")));// 子痫慢性高血压并发子痫前期
  117 + info.setComplicationRshbmxgxy(obj2Bool2Int(ocs.get("rshbmxgxy")));// 妊娠合并慢性高血压
  118 + info.setComplicationOther(obj2Bool2Int(ocs.get("qt")));// 其他(产科并发症)
  119 + info.setComplicationOtherText(OldNewWrapper.obj2Str(ocs.get("qtText")));// 其他并发症文本
117 120 }
118 121 }
119 122  
120 123 // 胎儿列表
121   - List<Map<String, Object>> placentas = req.getPlacentas();
122   - if(placentas!=null && !placentas.isEmpty()){
123   - for(Map<String, Object> map : placentas){
  124 + List<Map<String, Object>> placentas = req.getPlacentas();
  125 + if (placentas != null && !placentas.isEmpty()) {
  126 + for (Map<String, Object> map : placentas) {
124 127 ChildbirthTai tai = new ChildbirthTai();
125 128 tai.setHeartRate(OldNewWrapper.obj2Int(map.get("heartRate")));
126 129 tai.setFirstExpose(OldNewWrapper.obj2Int(map.get("fetalPresentation")));
127 130  
128 131  
129 132  
130 133  
131 134  
132 135  
133 136  
134 137  
135 138  
136 139  
137 140  
... ... @@ -128,63 +131,63 @@
128 131 taiList.add(tai);
129 132 }
130 133 }
131   -
  134 +
132 135 // 胎盘娩出方式
133   - List<Map<String, Object>> extPlacentas = req.getExtPlacentas();
134   - if(extPlacentas!=null && !extPlacentas.isEmpty()){
135   - for(Map<String, Object> placenta : extPlacentas){
  136 + List<Map<String, Object>> extPlacentas = req.getExtPlacentas();
  137 + if (extPlacentas != null && !extPlacentas.isEmpty()) {
  138 + for (Map<String, Object> placenta : extPlacentas) {
136 139 ChildbirthTaipan taipan = new ChildbirthTaipan();
137 140 taipan.setPlacentaBirthType(OldNewWrapper.obj2Int(placenta.get("tpmcType")));
138   - if("muMian".equals(placenta.get("mcType"))){
139   - taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_MUM);//母面
140   - }else{
141   - taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_SON);//子面
  141 + if ("muMian".equals(placenta.get("mcType"))) {
  142 + taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_MUM);// 母面
  143 + } else {
  144 + taipan.setBirthType(ChildbirthTaipan.BIRTH_TYPE_SON);// 子面
142 145 }
143 146 Map<String, Object> tpSize = (Map<String, Object>) placenta.get("tpSize");
144   - if(tpSize!=null){
  147 + if (tpSize != null) {
145 148 taipan.setPlacentaLength(OldNewWrapper.obj2Int(tpSize.get("c")));
146 149 taipan.setPlacentaWidth(OldNewWrapper.obj2Int(tpSize.get("k")));
147 150 taipan.setPlacentaThick(OldNewWrapper.obj2Int(tpSize.get("g")));
148 151 }
149 152 taipan.setPlacentaWeight(OldNewWrapper.obj2Int(placenta.get("tpWeight")));
150 153 taipan.setUmbilicalLength(OldNewWrapper.obj2Int(placenta.get("umbilicalCordLength")));
151   - if("yes".equals(placenta.get("umbilicalCordEx"))){//脐带有异常
  154 + if ("yes".equals(placenta.get("umbilicalCordEx"))) {// 脐带有异常
152 155 taipan.setUmbilicalException(OldNewWrapper.obj2Int(placenta.get("umbilicalCordExType")));
153   - }else{
  156 + } else {
154 157 taipan.setUmbilicalException(0);
155 158 }
156 159 taipanList.add(taipan);
157   - }
  160 + }
158 161 }
159   -
  162 +
160 163 // 新生儿
161   - List<Map<String, Object>> babies = req.getBabies();
162   - if(babies!=null && !babies.isEmpty()){
163   - for(Map<String, Object> baby : babies){
  164 + List<Map<String, Object>> babies = req.getBabies();
  165 + if (babies != null && !babies.isEmpty()) {
  166 + for (Map<String, Object> baby : babies) {
164 167 ChildbirthNewborn newborn = new ChildbirthNewborn();
165   - newborn.setGender(OldNewWrapper.obj2Int(baby.get("babyGender")));//性别
166   - newborn.setWeight(OldNewWrapper.obj2Int(baby.get("babyWeight")));//体重
167   - newborn.setHeight(OldNewWrapper.obj2Int(baby.get("babyHeight")));//身长
168   - newborn.setDeformity(OldNewWrapper.obj2Int(baby.get("deformity")));//是否畸形
169   -
170   - Map<String, Object> apgarScore = (Map<String, Object>)baby.get("apgarScore");
171   - if(apgarScore!=null && !apgarScore.isEmpty()){
172   - newborn.setApgarScoreOne(OldNewWrapper.obj2Int(baby.get("pf1")));//apgar评分1分钟
173   - newborn.setApgarScoreFive(OldNewWrapper.obj2Int(baby.get("pf5")));//apgar评分5分钟
174   - newborn.setApgarScoreTen(OldNewWrapper.obj2Int(baby.get("pf10")));//apgar评分10分钟
  168 + newborn.setGender(OldNewWrapper.obj2Int(baby.get("babyGender")));// 性别
  169 + newborn.setWeight(OldNewWrapper.obj2Int(baby.get("babyWeight")));// 体重
  170 + newborn.setHeight(OldNewWrapper.obj2Int(baby.get("babyHeight")));// 身长
  171 + newborn.setDeformity(OldNewWrapper.obj2Int(baby.get("deformity")));// 是否畸形
  172 +
  173 + Map<String, Object> apgarScore = (Map<String, Object>) baby.get("apgarScore");
  174 + if (apgarScore != null && !apgarScore.isEmpty()) {
  175 + newborn.setApgarScoreOne(OldNewWrapper.obj2Int(baby.get("pf1")));// apgar评分1分钟
  176 + newborn.setApgarScoreFive(OldNewWrapper.obj2Int(baby.get("pf5")));// apgar评分5分钟
  177 + newborn.setApgarScoreTen(OldNewWrapper.obj2Int(baby.get("pf10")));// apgar评分10分钟
175 178 }
176   -
177   - newborn.setAsphyxia(OldNewWrapper.obj2Int(baby.get("asphyxiaM")));//窒息分钟
178   - newborn.setGestationEnding(OldNewWrapper.obj2Int(baby.get("pregnancyOut")));//妊娠结局(枚举)
179   - newborn.setDisease(OldNewWrapper.obj2Str(baby.get("babyHealthy")));//新生儿疾病
180   - newborn.setTouchBegin(OldNewWrapper.obj2Int(baby.get("contactStartM")));//母婴接触开始时间
181   - newborn.setTouchStay(OldNewWrapper.obj2Int(baby.get("contactM")));//母婴接触持续时间
182   - if("yes".equals(OldNewWrapper.obj2Str(baby.get("earlySuck")))){
183   - newborn.setSuck(1);//早吸吮(枚举)1是,0否
184   - }else{
185   - newborn.setSuck(0);//早吸吮(枚举)1是,0否
  179 +
  180 + newborn.setAsphyxia(OldNewWrapper.obj2Int(baby.get("asphyxiaM")));// 窒息分钟
  181 + newborn.setGestationEnding(OldNewWrapper.obj2Int(baby.get("pregnancyOut")));// 妊娠结局(枚举)
  182 + newborn.setDisease(OldNewWrapper.obj2Str(baby.get("babyHealthy")));// 新生儿疾病
  183 + newborn.setTouchBegin(OldNewWrapper.obj2Int(baby.get("contactStartM")));// 母婴接触开始时间
  184 + newborn.setTouchStay(OldNewWrapper.obj2Int(baby.get("contactM")));// 母婴接触持续时间
  185 + if ("yes".equals(OldNewWrapper.obj2Str(baby.get("earlySuck")))) {
  186 + newborn.setSuck(1);// 早吸吮(枚举)1是,0否
  187 + } else {
  188 + newborn.setSuck(0);// 早吸吮(枚举)1是,0否
186 189 }
187   - newborn.setBirthTime(DateUtil.parseYMDHM(OldNewWrapper.obj2Str(baby.get("dueTime"))));//娩出时间
  190 + newborn.setBirthTime(DateUtil.parseYMDHM(OldNewWrapper.obj2Str(baby.get("dueTime"))));// 娩出时间
188 191 newbornList.add(newborn);
189 192 }
190 193 }
191 194  
... ... @@ -192,10 +195,225 @@
192 195 vo.setNewbornList(newbornList);
193 196 vo.setTaiList(taiList);
194 197 vo.setTaipanList(taipanList);
195   - }//if (req != null)
  198 + } // if (req != null)
196 199  
197 200 }
198 201  
  202 + public ChildbirthAddRequestWrapper(ChildbirthInfoVo vo) {
  203 + if (vo == null || vo.getInfo() == null) {
  204 + return;
  205 + }
  206 + this.vo = vo;
  207 + this.info = vo.getInfo();
  208 + this.newbornList = vo.getNewbornList();
  209 + this.taiList = vo.getTaiList();
  210 + this.taipanList = vo.getTaipanList();
  211 + /*
  212 + * 快速映射普通字段
  213 + */
  214 + // { 分娩ID、居民ID、孕妇ID、分娩孕周、胎儿数、胎盘数 }
  215 + // { (剖宫产)手术原因、 会阴撕裂、缝线针数、产妇情况、造成死亡的原因 }
  216 + // { 呼吸、脉搏、产后1小时失血量、产后2小时失血量、产后24小时失血量、第三产程+产后2小时失血量 }
  217 + // { 其他失血原因文本、 分娩医院、接生医生}
  218 + String[] req_map = { "id", "pid", "parentId", "dueWeek", "tireNumber", "placenta", "operationCause",
  219 + "siLielevel", "needleNum", "maternalInfo", "deathCause", "breath", "pulse", "oHloseBloodL",
  220 + "tHloseBloodL", "rHloseBloodL", "sHloseBloodL", "deathCauseText", "fmHospital", "deliverDoctor" };
  221 + String[] info_map = { "id", "personId", "womanId", "childbirthTimeText", "fetusNum", "placentaNum",
  222 + "operationReason", "perineumSplit", "needleNum", "womanSituation", "otherDeathReasonText", "breath",
  223 + "pulse", "loseBloodA", "loseBloodB", "loseBloodC", "loseBloodD", "loseBloodOtherText", "orgId",
  224 + "doctorId" };
  225 + Map<String, Object> reqMap = XjhMapUtil.transBean2AliasMap(this.info, XjhMapUtil.getKeyMap(req_map, info_map));
  226 + if (reqMap != null) {
  227 + this.request = (ChildbirthAddRequest) XjhMapUtil.transMap2Bean(reqMap, this.request);
  228 + }
  229 + /*
  230 + * 特殊字段处理
  231 + */
  232 + // 胎儿 placentas
  233 + List<Map<String, Object>> placentas = new ArrayList<>();
  234 + if (taiList != null && !taiList.isEmpty()) {
  235 + for (ChildbirthTai tai : taiList) {
  236 + Map<String, Object> map = new HashMap<>();
  237 + map.put("heartRate", tai.getHeartRate());
  238 + map.put("fetalPosition", tai.getPosition().toString());
  239 + map.put("fetalPresentation", tai.getFirstExpose().toString());
  240 + placentas.add(map);
  241 + }
  242 + }
  243 + this.request.setPlacentas(placentas);
  244 +
  245 + // 分娩方式 deliveryMode
  246 + Map<String, Object> deliveryMode = new HashMap<>();
  247 + Integer childbirthType = info.getChildbirthType();
  248 + if (childbirthType.equals(1)) {// 剖宫产
  249 + deliveryMode.put("fmfs", "1");
  250 + } else {// 顺产
  251 + deliveryMode.put("fmfs", "0");
  252 + deliveryMode.put("scfs", childbirthType.toString());
  253 + }
  254 + this.request.setDeliveryMode(deliveryMode);
  255 +
  256 + // 产程时间 prodprocess
  257 + Map<String, Object> prodprocess = new HashMap<>();
  258 + prodprocess.put("one", getProcessMap(info.getProcessFirst()));
  259 + prodprocess.put("two", getProcessMap(info.getProcessSecond()));
  260 + prodprocess.put("three", getProcessMap(info.getProcessThird()));
  261 + this.request.setProdprocess(prodprocess);
  262 +
  263 + // 总产程时间 totalprocess
  264 + this.request.setTotalprocess(getProcessMap(info.getProcessTotal()));
  265 +
  266 + // 会阴情况:1完整,2切开
  267 + if (info.getPerineumSituation() != null) {
  268 + if (info.getPerineumSituation() == ChildbirthInfo.PERINEUM_SITUATION_SPLIT) {
  269 + this.request.setPerinealCondition("split");
  270 + } else {
  271 + this.request.setPerinealCondition("full");
  272 + }
  273 + }
  274 +
  275 + // chBp 产后血压
  276 + Map<String, Object> chBp = new HashMap<>();
  277 + chBp.put("szy", info.getBloodDiastole());
  278 + chBp.put("ssy", info.getBloodShrink());
  279 + this.request.setChBp(chBp);
  280 +
  281 + // ch2Bp 产后两小时血压
  282 + Map<String, Object> ch2Bp = new HashMap<>();
  283 + ch2Bp.put("szy", info.getBloodDiastoleLater());
  284 + ch2Bp.put("ssy", info.getBloodShrinkLater());
  285 + this.request.setChBp(ch2Bp);
  286 +
  287 + // loseBloodCause 其他失血原因文本
  288 + Map<String, Object> loseBloodCause = new HashMap<>();
  289 + if (!StringUtils.isEmpty(info.getLoseBloodOtherText())) {
  290 + loseBloodCause.put("select", "1");
  291 + loseBloodCause.put("other", info.getLoseBloodOtherText());
  292 + } else {
  293 + loseBloodCause.put("select", "0");
  294 + loseBloodCause.put("other", "");
  295 + }
  296 + this.request.setLoseBloodCause(loseBloodCause);
  297 +
  298 + // ocs
  299 + Map<String, Object> ocs = new HashMap<>();
  300 + String yesOrNo = "no";
  301 + if (int2Bool(info.getComplicationQztp())) {// 前置胎盘
  302 + yesOrNo = "yes";
  303 + ocs.put("qztp", true);
  304 + }
  305 + if (int2Bool(info.getComplicationTpzb())) {// 胎盘早剥
  306 + yesOrNo = "yes";
  307 + ocs.put("tpzb", true);
  308 + }
  309 + if (int2Bool(info.getComplicationTpzl())) {// 胎盘滞留
  310 + yesOrNo = "yes";
  311 + ocs.put("tpzl", true);
  312 + }
  313 + if (int2Bool(info.getComplicationTmzp())) {// 胎膜早破
  314 + yesOrNo = "yes";
  315 + ocs.put("tmzp", true);
  316 + }
  317 + if (int2Bool(info.getComplicationChcx())) {// 产后出血
  318 + yesOrNo = "yes";
  319 + ocs.put("chcx", true);
  320 + }
  321 + if (int2Bool(info.getComplicationRsqgxy())) {// 妊娠期高血压
  322 + yesOrNo = "yes";
  323 + ocs.put("rsqgxy", true);
  324 + }
  325 + if (int2Bool(info.getComplicationZxa())) {// 子痫前期(轻)
  326 + yesOrNo = "yes";
  327 + ocs.put("zxqqq", true);
  328 + }
  329 + if (int2Bool(info.getComplicationZxb())) {// 子痫前期(重)
  330 + yesOrNo = "yes";
  331 + ocs.put("zxqqz", true);
  332 + }
  333 + if (int2Bool(info.getComplicationZxc())) {// 子痫慢性高血压并发子痫前期
  334 + yesOrNo = "yes";
  335 + ocs.put("zxmxgxybfzxqq", true);
  336 + }
  337 + if (int2Bool(info.getComplicationRshbmxgxy())) {// 妊娠合并慢性高血压
  338 + yesOrNo = "yes";
  339 + ocs.put("rshbmxgxy", true);
  340 + }
  341 + if (int2Bool(info.getComplicationOther())) {// 其他(产科并发症)
  342 + yesOrNo = "yes";
  343 + ocs.put("qt", true);
  344 + }
  345 + ocs.put("qtText", info.getComplicationOtherText());
  346 + ocs.put("yesOrNo", yesOrNo);
  347 + this.request.setOcs(ocs);
  348 +
  349 + // extPlacentas 胎盘
  350 + List<Map<String, Object>> extPlacentas = new ArrayList<>();
  351 + if (taipanList != null && !taipanList.isEmpty()) {
  352 + for (ChildbirthTaipan taipan : taipanList) {
  353 + Map<String, Object> map = new HashMap<>();
  354 +
  355 + map.put("tpmcType", taipan.getPlacentaBirthType());
  356 + if (taipan.getBirthType().intValue() == ChildbirthTaipan.BIRTH_TYPE_MUM) {
  357 + map.put("mcType", "muMian");
  358 + } else if (taipan.getBirthType().intValue() == ChildbirthTaipan.BIRTH_TYPE_SON) {
  359 + map.put("mcType", "ziMian");
  360 + }
  361 + Map<String, Object> tpSize = new HashMap<>();
  362 + tpSize.put("c", taipan.getPlacentaLength());
  363 + tpSize.put("k", taipan.getPlacentaWidth());
  364 + tpSize.put("g", taipan.getPlacentaThick());
  365 + map.put("tpSize", tpSize);
  366 + map.put("tpWeight", taipan.getPlacentaWeight());
  367 + map.put("umbilicalCordLength", taipan.getUmbilicalLength());
  368 + if (taipan.getUmbilicalException() != null) {
  369 + if (taipan.getUmbilicalException().intValue() != 0) {
  370 + map.put("umbilicalCordEx", "yes");
  371 + map.put("umbilicalCordExType", taipan.getUmbilicalException());
  372 + }
  373 + }
  374 + extPlacentas.add(map);
  375 + }
  376 + }
  377 + this.request.setExtPlacentas(extPlacentas);
  378 +
  379 + // babies 新生儿列表
  380 + List<Map<String, Object>> babies = new ArrayList<>();
  381 + if (newbornList != null && !newbornList.isEmpty()) {
  382 + for (ChildbirthNewborn newborn : newbornList) {
  383 + Map<String, Object> map = new HashMap<>();
  384 + map.put("id", newborn.getId());
  385 + map.put("babyGender", newborn.getGender().toString());
  386 + map.put("babyWeight", newborn.getWeight().toString());
  387 + map.put("babyHeight", newborn.getHeight().toString());
  388 + map.put("deformity", newborn.getDeformity());
  389 +
  390 + Map<String, Object> apgarScore = new HashMap<>();
  391 + apgarScore.put("pf1", newborn.getApgarScoreOne());
  392 + apgarScore.put("pf5", newborn.getApgarScoreFive());
  393 + apgarScore.put("pf10", newborn.getApgarScoreTen());
  394 + map.put("apgarScore", apgarScore);
  395 +
  396 + map.put("asphyxiaM", newborn.getAsphyxia());
  397 + map.put("pregnancyOut", newborn.getGestationEnding().toString());
  398 + map.put("babyHealthy", newborn.getDisease());
  399 + map.put("contactStartM", newborn.getTouchBegin());
  400 + map.put("contactM", newborn.getTouchStay());
  401 + if (newborn.getSuck() != null) {
  402 + if (newborn.getSuck() == 1) {
  403 + map.put("earlySuck", "yes");
  404 + } else {
  405 + map.put("earlySuck", "no");
  406 + }
  407 + }
  408 + map.put("dueTime", DateUtil.getyyyy_MM_dd_hms(newborn.getBirthTime()));
  409 + babies.add(map);
  410 + }
  411 + }
  412 + this.request.setBabies(babies);
  413 + }
  414 +
  415 + // =====================================================================================
  416 +
199 417 private String getProcessStr(Map<String, Object> map) {
200 418 String str = "";
201 419 if (map != null && !map.isEmpty()) {
202 420  
... ... @@ -205,10 +423,35 @@
205 423 }
206 424 return str;
207 425 }
208   -
209   - private int obj2Bool2Int(Object obj){
  426 +
  427 + private Map<String, Integer> getProcessMap(String str) {
  428 + if (StringUtils.isEmpty(str)) {
  429 + return null;
  430 + }
  431 + String[] strs = str.split("-");
  432 + if (strs == null || strs.length != 2) {
  433 + return null;
  434 + }
  435 + Map<String, Integer> map = new HashMap<>();
  436 + map.put("h", Integer.parseInt(strs[0]));
  437 + map.put("m", Integer.parseInt(strs[1]));
  438 + return map;
  439 + }
  440 +
  441 + private int obj2Bool2Int(Object obj) {
210 442 Boolean bool = OldNewWrapper.obj2Bool(obj);
211 443 return OldNewWrapper.bool2Int(bool);
  444 + }
  445 +
  446 + private boolean int2Bool(Integer intObj) {
  447 + if (intObj == null) {
  448 + return false;
  449 + }
  450 + if (intObj.equals(1)) {
  451 + return true;
  452 + } else {
  453 + return false;
  454 + }
212 455 }
213 456  
214 457 public ChildbirthAddRequest getRequest() {