Commit 91a052c9667cfb9f82b615da0e84d1a9f07e90b3
1 parent
913199e234
Exists in
master
日常提交-解决冲突
Showing 29 changed files with 1912 additions and 724 deletions
- parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/diagnose/DiagnoseInfo.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthInfoService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthInfoServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/DiagnoseInfoService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseInfoServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/WomanFetationRecordService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanPersonServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/util/HospitalUtil.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/util/UnitConstants.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/util/trans/OldDictionary.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthInfoController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthNewbornController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthTaiController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthTaipanController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequest.java
- parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java
- parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ExamAddRequestWrapper.java
- parent/hospital.web/src/main/java/com/lyms/hospital/util/HospitalUtil.java
- parent/hospital.web/src/main/java/com/lyms/hospital/util/UnitConstants.java
- parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/OldDictionary.java
- parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java
- parent/hospital.web/src/main/resources/xml/app-shiro.xml
parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java
View file @
91a052c
| ... | ... | @@ -72,6 +72,17 @@ |
| 72 | 72 | * <li>修改时间: |
| 73 | 73 | */ |
| 74 | 74 | public Page<Organizations> listOrgs(Page<Organizations> page,Serializable orgids); |
| 75 | + | |
| 76 | + /** | |
| 77 | + * <li>@Description:通过机构ID获取机构名称 | |
| 78 | + * <li>@param id | |
| 79 | + * <li>@return | |
| 80 | + * <li>创建人:xujiahong | |
| 81 | + * <li>创建时间:2017年5月8日 | |
| 82 | + * <li>修改人: | |
| 83 | + * <li>修改时间: | |
| 84 | + */ | |
| 85 | + public String getNameById(String id); | |
| 75 | 86 | |
| 76 | 87 | } |
parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganizationsServiceImpl.java
View file @
91a052c
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/diagnose/DiagnoseInfo.java
View file @
91a052c
| ... | ... | @@ -20,9 +20,9 @@ |
| 20 | 20 | |
| 21 | 21 | private static final long serialVersionUID = 1L; |
| 22 | 22 | |
| 23 | - //诊断类型,0为初诊,1为复诊 | |
| 24 | - public static final int TYPE_FIRST = 1; | |
| 25 | - public static final int TYPE_SECOND = 2; | |
| 23 | + //诊断类型,2为初诊,3为复诊 | |
| 24 | + public static final int TYPE_FIRST = 2; | |
| 25 | + public static final int TYPE_SECOND = 3; | |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * |
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | @TableField(value = "WOMAN_ID") |
| 36 | 36 | private String womanId; |
| 37 | 37 | /** |
| 38 | - * 诊断类型,0为初诊,1为复诊 | |
| 38 | + * 诊断类型,2为初诊,3为复诊 | |
| 39 | 39 | */ |
| 40 | 40 | @TableField(value = "TYPE") |
| 41 | 41 | private Integer type; |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthInfoService.java
View file @
91a052c
| 1 | 1 | package com.lyms.hospital.service.childbirth; |
| 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.hospital.entity.childbirth.ChildbirthInfo; |
| ... | ... | @@ -96,6 +97,17 @@ |
| 96 | 97 | * <li>修改时间: |
| 97 | 98 | */ |
| 98 | 99 | public Page<ChildbirthListVo> listOfChildbirth(Page<ChildbirthListVo> page,ChildbirthListVo vo); |
| 100 | + | |
| 101 | + /** | |
| 102 | + * <li>@Description:通过孕妇ID查询所有分娩记录 | |
| 103 | + * <li>@param womanId | |
| 104 | + * <li>@return | |
| 105 | + * <li>创建人:xujiahong | |
| 106 | + * <li>创建时间:2017年5月8日 | |
| 107 | + * <li>修改人: | |
| 108 | + * <li>修改时间: | |
| 109 | + */ | |
| 110 | + public List<ChildbirthInfo> selectListByWomanId(String womanId); | |
| 99 | 111 | |
| 100 | 112 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthInfoServiceImpl.java
View file @
91a052c
| ... | ... | @@ -121,7 +121,6 @@ |
| 121 | 121 | @Override |
| 122 | 122 | @Transactional |
| 123 | 123 | public ChildbirthInfoVo selectChildbirthVo(String id) { |
| 124 | - // TODO Auto-generated method stub | |
| 125 | 124 | ChildbirthInfoVo vo = new ChildbirthInfoVo(); |
| 126 | 125 | //查询分娩详情 |
| 127 | 126 | vo.setInfo(this.getDetailById(id)); |
| ... | ... | @@ -251,6 +250,16 @@ |
| 251 | 250 | List<ChildbirthListVo> list = infoMapper.listOfChildbirth(page,vo); |
| 252 | 251 | page.setRecords(list); |
| 253 | 252 | return page; |
| 253 | + } | |
| 254 | + | |
| 255 | + @Override | |
| 256 | + public List<ChildbirthInfo> selectListByWomanId(String womanId) { | |
| 257 | + if(StringUtils.isEmpty(womanId)){ | |
| 258 | + return null; | |
| 259 | + } | |
| 260 | + EntityWrapper<ChildbirthInfo> ew = new EntityWrapper<ChildbirthInfo>(); | |
| 261 | + ew.where("WOMAN_ID = {0}", womanId); | |
| 262 | + return this.selectList(ew); | |
| 254 | 263 | } |
| 255 | 264 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/DiagnoseInfoService.java
View file @
91a052c
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import java.io.Serializable; |
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | +import com.lyms.base.common.entity.conf.DiagnoseConf; | |
| 6 | 7 | import com.lyms.base.common.entity.conf.HighriskConf; |
| 7 | 8 | import com.lyms.hospital.entity.assist.DiagnoseAssit; |
| 8 | 9 | import com.lyms.hospital.entity.diagnose.DiagnoseInfo; |
| ... | ... | @@ -14,8 +15,9 @@ |
| 14 | 15 | * <p> |
| 15 | 16 | * 服务类 |
| 16 | 17 | * |
| 17 | - * 保存初诊数据 | |
| 18 | - * 保存复诊数据 | |
| 18 | + * 保存初诊数据<br/> | |
| 19 | + * 保存复诊数据<br/> | |
| 20 | + * 根据孕妇建档ID查询产检基本信息列表<br/> | |
| 19 | 21 | * </p> |
| 20 | 22 | * |
| 21 | 23 | * @author jiangjiazhi |
| ... | ... | @@ -23,24 +25,48 @@ |
| 23 | 25 | */ |
| 24 | 26 | public interface DiagnoseInfoService extends BaseService<DiagnoseInfo> { |
| 25 | 27 | |
| 26 | - /** | |
| 27 | - * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除 | |
| 28 | - * <li>@param id 删除主键id | |
| 29 | - * <li>@return 大于0修改成功,否则为失败 | |
| 30 | - */ | |
| 31 | - public Integer deleteLogicById(Serializable id); | |
| 32 | - | |
| 33 | - /** | |
| 34 | - * <li>@Description:保存初诊数据 | |
| 35 | - * <li>@return | |
| 36 | - * <li>创建人:xujiahong | |
| 37 | - * <li>创建时间:2017年4月26日 | |
| 38 | - * <li>修改人: | |
| 39 | - * <li>修改时间: | |
| 40 | - */ | |
| 41 | - public String saveFirstExam(DiagnoseInfo info,DiagnoseAssit assist,List<HistoryMaps> historyList,List<DiagnoseTai> taiList); | |
| 42 | - | |
| 43 | - /** | |
| 28 | + /** | |
| 29 | + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除 | |
| 30 | + * <li>@param id 删除主键id | |
| 31 | + * <li>@return 大于0修改成功,否则为失败 | |
| 32 | + */ | |
| 33 | + public Integer deleteLogicById(Serializable id); | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * <li>@Description:根据孕妇建档ID查询产检基本信息列表 | |
| 37 | + * <li>@param womanId | |
| 38 | + * <li>@return | |
| 39 | + * <li>创建人:xujiahong | |
| 40 | + * <li>创建时间:2017年5月5日 | |
| 41 | + * <li>修改人: | |
| 42 | + * <li>修改时间: | |
| 43 | + */ | |
| 44 | + public List<DiagnoseInfo> getInfoListByWomanId(String womanId); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * <li>@Description:保存初诊数据 | |
| 48 | + * <li>@return | |
| 49 | + * <li>创建人:xujiahong | |
| 50 | + * <li>创建时间:2017年4月26日 | |
| 51 | + * <li>修改人: | |
| 52 | + * <li>修改时间: | |
| 53 | + */ | |
| 54 | + public String saveFirstExam(DiagnoseInfo info, DiagnoseAssit assist, List<HistoryMaps> historyList, | |
| 55 | + List<DiagnoseTai> taiList); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * <li>@Description:保存复诊数据 | |
| 59 | + * <li>@param info | |
| 60 | + * <li>@param taiList | |
| 61 | + * <li>@return | |
| 62 | + * <li>创建人:xujiahong | |
| 63 | + * <li>创建时间:2017年5月5日 | |
| 64 | + * <li>修改人: | |
| 65 | + * <li>修改时间: | |
| 66 | + */ | |
| 67 | + public String saveLaterExam(DiagnoseInfo info, List<DiagnoseTai> taiList); | |
| 68 | + | |
| 69 | + /** | |
| 44 | 70 | * <li>@Description:根据居民ID获取末次高危 |
| 45 | 71 | * <li>@param personId 居民ID |
| 46 | 72 | * <li>@return |
| ... | ... | @@ -50,6 +76,17 @@ |
| 50 | 76 | * <li>修改时间: |
| 51 | 77 | */ |
| 52 | 78 | public List<HighriskConf> getLastHighrisk(Serializable personId); |
| 79 | + | |
| 80 | + /** | |
| 81 | + * <li>@Description:根据居民ID获取末次诊断 | |
| 82 | + * <li>@param personId | |
| 83 | + * <li>@return | |
| 84 | + * <li>创建人:方承 | |
| 85 | + * <li>创建时间:2017年5月8日 | |
| 86 | + * <li>修改人: | |
| 87 | + * <li>修改时间: | |
| 88 | + */ | |
| 89 | + public List<DiagnoseConf> getLastDiagnose(Serializable personId); | |
| 53 | 90 | |
| 54 | 91 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseInfoServiceImpl.java
View file @
91a052c
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | |
| 11 | 11 | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| 12 | 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| 13 | +import com.lyms.base.common.entity.conf.DiagnoseConf; | |
| 13 | 14 | import com.lyms.base.common.entity.conf.HighriskConf; |
| 14 | 15 | import com.lyms.hospital.dao.diagnose.DiagnoseInfoMapper; |
| 15 | 16 | import com.lyms.hospital.entity.assist.DiagnoseAssit; |
| ... | ... | @@ -129,7 +130,7 @@ |
| 129 | 130 | */ |
| 130 | 131 | if (StringUtils.isEmpty(info.getId())) {// 新增 |
| 131 | 132 | info.setId(StrUtils.uuid()); |
| 132 | - info.setType(DiagnoseInfo.TYPE_FIRST);// 诊断类型,0为初诊,1为复诊 | |
| 133 | + info.setType(DiagnoseInfo.TYPE_FIRST);// 诊断类型,2为初诊,3为复诊 | |
| 133 | 134 | this.insert(info);// 新增产检基本信息 |
| 134 | 135 | if (StringUtils.isEmpty(assist.getId())) { |
| 135 | 136 | assist.setId(StrUtils.uuid()); |
| 136 | 137 | |
| 137 | 138 | |
| ... | ... | @@ -147,10 +148,52 @@ |
| 147 | 148 | diagnoseTaiService.deleteAndInsert(info.getId(), taiList); |
| 148 | 149 | return "success"; |
| 149 | 150 | } |
| 151 | + | |
| 152 | + @Override | |
| 153 | + public String saveLaterExam(DiagnoseInfo info, List<DiagnoseTai> taiList) { | |
| 154 | + /* | |
| 155 | + * 基础验证 | |
| 156 | + */ | |
| 157 | + if (info == null || taiList == null) { | |
| 158 | + return "参数缺失"; | |
| 159 | + } | |
| 150 | 160 | |
| 161 | + /* | |
| 162 | + * (1)保存产检基本信息 (2)批量保存产检胎儿信息 | |
| 163 | + * (3)保存诊断信息 TODO | |
| 164 | + */ | |
| 165 | + if (StringUtils.isEmpty(info.getId())) {// 新增 | |
| 166 | + info.setId(StrUtils.uuid()); | |
| 167 | + info.setType(DiagnoseInfo.TYPE_SECOND);// 诊断类型,2为初诊,3为复诊 | |
| 168 | + this.insert(info);// 新增产检基本信息 | |
| 169 | + } else {// 修改 | |
| 170 | + this.updateById(info); | |
| 171 | + } | |
| 172 | + //批量保存产检胎儿信息 | |
| 173 | + diagnoseTaiService.deleteAndInsert(info.getId(), taiList); | |
| 174 | + return "success"; | |
| 175 | + } | |
| 176 | + | |
| 177 | + | |
| 151 | 178 | @Override |
| 152 | 179 | public List<HighriskConf> getLastHighrisk(Serializable personId) { |
| 153 | 180 | return baseMapper.getLastHighrisk(personId); |
| 154 | 181 | } |
| 182 | + | |
| 183 | + @Override | |
| 184 | + public List<DiagnoseInfo> getInfoListByWomanId(String womanId) { | |
| 185 | + if(StringUtils.isEmpty(womanId)){ | |
| 186 | + return null; | |
| 187 | + } | |
| 188 | + EntityWrapper<DiagnoseInfo> ew = new EntityWrapper<DiagnoseInfo>(); | |
| 189 | + ew.where("WOMAN_ID={0}", womanId); | |
| 190 | + return selectList(ew); | |
| 191 | + } | |
| 192 | + | |
| 193 | + | |
| 194 | + @Override | |
| 195 | + public List<DiagnoseConf> getLastDiagnose(Serializable personId) { | |
| 196 | + return baseMapper.getLastDiagnose(personId); | |
| 197 | + } | |
| 155 | 198 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/WomanFetationRecordService.java
View file @
91a052c
| ... | ... | @@ -16,12 +16,24 @@ |
| 16 | 16 | * 查询-根据孕妇建档ID查询表单详情 |
| 17 | 17 | * 查询-查询历史建档记录(by证件信息和就诊卡号) |
| 18 | 18 | * </p> |
| 19 | + * 依据cardNo或vcCardNo查询孕妇信息<br/> | |
| 19 | 20 | * |
| 20 | 21 | * @author fangcheng,xujiahong |
| 21 | 22 | * @since 2017-03-31 |
| 22 | 23 | */ |
| 23 | 24 | public interface WomanFetationRecordService extends BaseService<WomanFetationRecord> { |
| 24 | 25 | |
| 26 | + /** | |
| 27 | + * <li>@Description:依据cardNo或vcCardNo查询孕妇信息(顶部top) | |
| 28 | + * <li>@param cardNo | |
| 29 | + * <li>@param vcCardNo | |
| 30 | + * <li>@return | |
| 31 | + * <li>创建人:xujiahong | |
| 32 | + * <li>创建时间:2017年5月6日 | |
| 33 | + * <li>修改人: | |
| 34 | + * <li>修改时间: | |
| 35 | + */ | |
| 36 | + public Map<String, Object> selectTopFetationInfo(String cardNo, String vcCardNo, String orgId); | |
| 25 | 37 | |
| 26 | 38 | /** |
| 27 | 39 | * <li>@Description:条件查询有效的(未被删除的,启用的,未终止妊娠的,未分娩的&其他指定条件)孕妇建档 |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java
View file @
91a052c
| 1 | 1 | package com.lyms.hospital.service.woman.impl; |
| 2 | 2 | |
| 3 | 3 | import java.io.Serializable; |
| 4 | +import java.util.ArrayList; | |
| 4 | 5 | import java.util.Date; |
| 5 | 6 | import java.util.HashMap; |
| 6 | 7 | import java.util.List; |
| 7 | 8 | |
| ... | ... | @@ -24,7 +25,9 @@ |
| 24 | 25 | import com.lyms.hospital.service.woman.WomanFetationRecordService; |
| 25 | 26 | import com.lyms.hospital.service.woman.WomanHusbandService; |
| 26 | 27 | import com.lyms.hospital.service.woman.WomanPersonService; |
| 28 | +import com.lyms.hospital.util.HospitalUtil; | |
| 27 | 29 | import com.lyms.util.CollectionUtils; |
| 30 | +import com.lyms.util.DateUtil; | |
| 28 | 31 | import com.lyms.util.InstanceUtils; |
| 29 | 32 | import com.lyms.util.StrUtils; |
| 30 | 33 | |
| ... | ... | @@ -46,6 +49,7 @@ |
| 46 | 49 | @Autowired |
| 47 | 50 | private WomanFetationRecordMapper fetationMapper; |
| 48 | 51 | |
| 52 | + | |
| 49 | 53 | public Integer deleteLogicById(Serializable id){ |
| 50 | 54 | WomanFetationRecord w = selectById(id); |
| 51 | 55 | if(w==null){ |
| ... | ... | @@ -118,8 +122,10 @@ |
| 118 | 122 | obj.setSourceId(id); |
| 119 | 123 | } |
| 120 | 124 | obj.setCreateTime(new Date()); |
| 121 | - obj.setIfdel(IfdelEnum.NO.getStatus()); | |
| 122 | - obj.setEnalble(StatusEnum.ENABLED.getStatus()); | |
| 125 | + obj.setIfdel(IfdelEnum.NO.getStatus());//未被删除的 | |
| 126 | + obj.setEnalble(StatusEnum.ENABLED.getStatus());//启用的 | |
| 127 | + obj.setWomanType(1);//妇女类别:1孕妇,3产妇 | |
| 128 | + obj.setDueStatus(0);//分娩状态 0未终止妊娠 1终止妊娠 | |
| 123 | 129 | if (insert(obj)) { |
| 124 | 130 | return id; |
| 125 | 131 | } |
| ... | ... | @@ -261,5 +267,61 @@ |
| 261 | 267 | } |
| 262 | 268 | return dataList; |
| 263 | 269 | } |
| 270 | + | |
| 271 | + @Override | |
| 272 | + public Map<String, Object> selectTopFetationInfo(String cardNo, String vcCardNo, String orgId) { | |
| 273 | + | |
| 274 | + // 孕妇档案信息(通过证件号或就诊卡号查询) | |
| 275 | + WomanFetationRecord query = new WomanFetationRecord(); | |
| 276 | + query.setHostpitalId(orgId);// 医院ID | |
| 277 | + WomanFetationRecord dbFetationRecord = null; | |
| 278 | + | |
| 279 | + // 证件号不为空,则通过证件号查询 | |
| 280 | + if (!StringUtils.isEmpty(cardNo)) { | |
| 281 | + query.setBasePapersNumber(cardNo); | |
| 282 | + dbFetationRecord = this.queryEffectiveOne(query); | |
| 283 | + } | |
| 284 | + // 上述查询未执行或没结果,且就诊卡号不为空,则通过就诊卡号查询 | |
| 285 | + if (dbFetationRecord == null && !StringUtils.isEmpty(vcCardNo)) { | |
| 286 | + query.setBasePapersNumber(null); | |
| 287 | + query.setContactWomanWay(vcCardNo); | |
| 288 | + dbFetationRecord = this.queryEffectiveOne(query); | |
| 289 | + } | |
| 290 | + // 未查询到孕妇建档信息 | |
| 291 | + if (dbFetationRecord == null) { | |
| 292 | + return null; | |
| 293 | + } | |
| 294 | + | |
| 295 | + // 组装返回对象 | |
| 296 | + Map<String, Object> dataMap = new HashMap<>(); | |
| 297 | + dataMap.put("id", dbFetationRecord.getId()); | |
| 298 | + dataMap.put("pid", dbFetationRecord.getWomanPersonId()); | |
| 299 | + dataMap.put("name", dbFetationRecord.getBaseWomanName()); | |
| 300 | + dataMap.put("age", DateUtil.getAge(dbFetationRecord.getBaseWomanBirth())); | |
| 301 | + // 根据“纠正末次月经”计算孕周 | |
| 302 | + dataMap.put("dueWeek", HospitalUtil.getPregnantWeek(dbFetationRecord.getHospitalCorrectLastMenstruation())); | |
| 303 | + dataMap.put("yChanQi", dbFetationRecord.getHospitalExpectedDateStr()); | |
| 304 | + dataMap.put("phone", dbFetationRecord.getContactWomanWay()); | |
| 305 | + dataMap.put("riskScore", "15");// TODO 高危评分 | |
| 306 | + dataMap.put("remarks", dbFetationRecord.getHospitalRecordRemark()); | |
| 307 | + dataMap.put("lastMenses", dbFetationRecord.getHospitalLastMenstruationStr()); | |
| 308 | + dataMap.put("buildTime", dbFetationRecord.getHospitalRecordDateStr());// 建档日期 | |
| 309 | + dataMap.put("lastBuildTime", dbFetationRecord.getHospitalRecordDateStr());// TODO | |
| 310 | + | |
| 311 | + dataMap.put("birth", dbFetationRecord.getBaseWomanBirthStr()); | |
| 312 | + dataMap.put("tireNumber1", "1");// TODO ? | |
| 313 | + dataMap.put("cardNo", dbFetationRecord.getBasePapersNumber()); | |
| 314 | + dataMap.put("vcCardNo", dbFetationRecord.getHospitalPatientCard()); | |
| 315 | + dataMap.put("isSieve", "0");// TODO? | |
| 316 | + dataMap.put("isH", "0");// TODO? | |
| 317 | + | |
| 318 | + // 高危因素列表 TODO | |
| 319 | + List<Map<String, Object>> riskFactor = new ArrayList<>(); | |
| 320 | + dataMap.put("riskFactor", riskFactor);//高危因素列表 | |
| 321 | + | |
| 322 | + dataMap.put("now", DateUtil.getyyyy_MM_dd(new Date())); | |
| 323 | + dataMap.put("dbFetationRecord", dbFetationRecord);//调用者可以直接访问详情对象,之后可以remove掉,不传递给前端显示 | |
| 324 | + return dataMap; | |
| 325 | + } | |
| 264 | 326 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanPersonServiceImpl.java
View file @
91a052c
| ... | ... | @@ -43,6 +43,13 @@ |
| 43 | 43 | |
| 44 | 44 | @Override |
| 45 | 45 | public String insertOrUpdate(WomanFetationRecord womanFetationRecord) { |
| 46 | + if(womanFetationRecord==null){ | |
| 47 | + return null; | |
| 48 | + } | |
| 49 | + //如果没有“纠正末次月经”,则设置为与“末次月经”相同 | |
| 50 | + if(womanFetationRecord.getHospitalCorrectLastMenstruation()==null){ | |
| 51 | + womanFetationRecord.setHospitalCorrectLastMenstruation(womanFetationRecord.getHospitalLastMenstruation()); | |
| 52 | + } | |
| 46 | 53 | WomanPerson wp = findByCard(womanFetationRecord.getBasePapersType(), womanFetationRecord.getBasePapersNumber()); |
| 47 | 54 | if (null == wp) { // 插入 |
| 48 | 55 | return insert(womanFetationRecord); |
parent/hospital.mac/src/main/java/com/lyms/hospital/util/HospitalUtil.java
View file @
91a052c
| 1 | +package com.lyms.hospital.util; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import com.lyms.util.DateUtil; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 计算孕周<br> | |
| 9 | + * a<br> | |
| 10 | + * | |
| 11 | + * @author xujiahong | |
| 12 | + * | |
| 13 | + */ | |
| 14 | +public class HospitalUtil { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * <li>@Description: | |
| 18 | + * <li>@param date 末次月经日期 | |
| 19 | + * <li>@return | |
| 20 | + * <li>创建人:xujiahong | |
| 21 | + * <li>创建时间:2017年4月24日 | |
| 22 | + * <li>修改人: | |
| 23 | + * <li>修改时间: | |
| 24 | + */ | |
| 25 | + public static String getPregnantWeek(Date date) { | |
| 26 | + Date now = new Date(); | |
| 27 | + return getPregnantWeek(date, now); | |
| 28 | + } | |
| 29 | + | |
| 30 | + public static String getPregnantWeek(Date date,Date now) { | |
| 31 | + if(date==null || now==null){ | |
| 32 | + return ""; | |
| 33 | + } | |
| 34 | + int days = DateUtil.daysBetween(date, now);//返回两个日期的间隔天数 | |
| 35 | + if (days < 0) { | |
| 36 | + return ""; | |
| 37 | + } | |
| 38 | + if (days >= 294) { | |
| 39 | + return "已分娩"; | |
| 40 | + } | |
| 41 | + int week = (days / 7); | |
| 42 | + int day = (days % 7); | |
| 43 | + return "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 44 | + } | |
| 45 | + | |
| 46 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/util/UnitConstants.java
View file @
91a052c
| 1 | +package com.lyms.hospital.util; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * | |
| 5 | + * 单位常量,用以返回值拼接 | |
| 6 | + * | |
| 7 | + * Created by Administrator on 2017/1/11 0011. | |
| 8 | + */ | |
| 9 | +public class UnitConstants { | |
| 10 | + | |
| 11 | + public static final String CM = " cm"; | |
| 12 | + public static final String KG = " kg"; | |
| 13 | + public static final String MMHG = " mmHg"; | |
| 14 | + public static final String CIFEN = " 次/分"; | |
| 15 | + public static final String GL = " g/L"; | |
| 16 | + public static final String MMOLL = " mmol/L"; | |
| 17 | + public static final String CI = " 次"; | |
| 18 | + public static final String UL = " U/L"; | |
| 19 | + public static final String TEN_LKG = "×10<sup>9</sup>/L"; | |
| 20 | +// public static final String TEN_LKG = " 10^9/L"; | |
| 21 | + public static final String UMOLL = " umol/L"; | |
| 22 | + public static final String ZHEN = " 针"; | |
| 23 | + public static final String ML = " ml"; | |
| 24 | + public static final String G = " g"; | |
| 25 | + public static final String FEN = " 分"; | |
| 26 | + public static final String FZ = " 分钟"; | |
| 27 | + public static final String GE = " 个"; | |
| 28 | + public static final String SUI = " 岁"; | |
| 29 | + public static final String REN = " 人"; | |
| 30 | + public static final String HD = " 时/日"; | |
| 31 | + public static final String WENDU = " ℃"; | |
| 32 | + public static final String WSSD = " IU/日"; | |
| 33 | + public static final String DAY = " 天"; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 拼接单位 | |
| 37 | + * @param data | |
| 38 | + * @param unit | |
| 39 | + * @return | |
| 40 | + */ | |
| 41 | + public static String splice(Object data,String unit){ | |
| 42 | + if (data==null || "/".equals(data)){ | |
| 43 | + return null; | |
| 44 | + } | |
| 45 | + return data.toString() + unit; | |
| 46 | + } | |
| 47 | + | |
| 48 | + | |
| 49 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/util/trans/OldDictionary.java
View file @
91a052c
| 1 | +package com.lyms.hospital.util.trans; | |
| 2 | + | |
| 3 | +public class OldDictionary { | |
| 4 | + | |
| 5 | + private String id; | |
| 6 | + private String hildConfigs; | |
| 7 | + private String code; | |
| 8 | + private String desc; | |
| 9 | + private Integer enable; | |
| 10 | + private String name; | |
| 11 | + private String parentId; | |
| 12 | + | |
| 13 | + public OldDictionary(){} | |
| 14 | + | |
| 15 | + public OldDictionary(String id,String name){ | |
| 16 | + this.id = id; | |
| 17 | + this.name = name; | |
| 18 | + this.enable = 1; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public String getId() { | |
| 22 | + return id; | |
| 23 | + } | |
| 24 | + public void setId(String id) { | |
| 25 | + this.id = id; | |
| 26 | + } | |
| 27 | + public String getHildConfigs() { | |
| 28 | + return hildConfigs; | |
| 29 | + } | |
| 30 | + public void setHildConfigs(String hildConfigs) { | |
| 31 | + this.hildConfigs = hildConfigs; | |
| 32 | + } | |
| 33 | + public String getCode() { | |
| 34 | + return code; | |
| 35 | + } | |
| 36 | + public void setCode(String code) { | |
| 37 | + this.code = code; | |
| 38 | + } | |
| 39 | + public String getDesc() { | |
| 40 | + return desc; | |
| 41 | + } | |
| 42 | + public void setDesc(String desc) { | |
| 43 | + this.desc = desc; | |
| 44 | + } | |
| 45 | + public Integer getEnable() { | |
| 46 | + return enable; | |
| 47 | + } | |
| 48 | + public void setEnable(Integer enable) { | |
| 49 | + this.enable = enable; | |
| 50 | + } | |
| 51 | + public String getName() { | |
| 52 | + return name; | |
| 53 | + } | |
| 54 | + public void setName(String name) { | |
| 55 | + this.name = name; | |
| 56 | + } | |
| 57 | + public String getParentId() { | |
| 58 | + return parentId; | |
| 59 | + } | |
| 60 | + public void setParentId(String parentId) { | |
| 61 | + this.parentId = parentId; | |
| 62 | + } | |
| 63 | + | |
| 64 | + | |
| 65 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java
View file @
91a052c
| 1 | +package com.lyms.hospital.util.trans; | |
| 2 | + | |
| 3 | +import java.beans.BeanInfo; | |
| 4 | +import java.beans.Introspector; | |
| 5 | +import java.beans.PropertyDescriptor; | |
| 6 | +import java.lang.reflect.InvocationTargetException; | |
| 7 | +import java.lang.reflect.Method; | |
| 8 | +import java.util.Date; | |
| 9 | +import java.util.HashMap; | |
| 10 | +import java.util.HashSet; | |
| 11 | +import java.util.Map; | |
| 12 | +import java.util.Set; | |
| 13 | + | |
| 14 | +import com.lyms.hospital.entity.assist.DiagnoseAssit; | |
| 15 | +import com.lyms.util.DateUtil; | |
| 16 | + | |
| 17 | +public class XjhMapUtil { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 简单处理映射字段类型不匹配的情况 | |
| 21 | + * @param property 目标字段Bean相关信息 | |
| 22 | + * @param value 目标字段值 | |
| 23 | + * @param obj 对象 | |
| 24 | + * @author xujiahong | |
| 25 | + * @throws InvocationTargetException | |
| 26 | + * @throws IllegalArgumentException | |
| 27 | + * @throws IllegalAccessException | |
| 28 | + */ | |
| 29 | + private static void invokeIgnoreType(PropertyDescriptor property,Object value,Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ | |
| 30 | + if(obj==null || property==null){ | |
| 31 | + return; | |
| 32 | + } | |
| 33 | + // 得到property对应的setter方法 | |
| 34 | + Method setter = property.getWriteMethod(); | |
| 35 | + if(value==null){//null值可匹配任何类型的对象 | |
| 36 | + setter.invoke(obj, value); | |
| 37 | + return; | |
| 38 | + } | |
| 39 | + Class<?> keyType = property.getPropertyType(); | |
| 40 | + Class<?> valueType = value.getClass(); | |
| 41 | + //简单处理映射字段类型不匹配的情况 | |
| 42 | + if (keyType.equals(valueType)) { | |
| 43 | + setter.invoke(obj, value); | |
| 44 | + } else { | |
| 45 | + if(keyType.equals(String.class)){ | |
| 46 | + setter.invoke(obj, value.toString()); | |
| 47 | + }else if(keyType.equals(Integer.class)){ | |
| 48 | + setter.invoke(obj, Integer.parseInt(value.toString())); | |
| 49 | + }else if(keyType.equals(Double.class)){ | |
| 50 | + setter.invoke(obj, Double.parseDouble(value.toString())); | |
| 51 | + }else{ | |
| 52 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 53 | + System.err.println("字段【"+property.getName()+"】没有可匹配的自动转换类型"); | |
| 54 | + } | |
| 55 | + } | |
| 56 | + } | |
| 57 | + | |
| 58 | + public static Object transMap2Bean(Map<String, Object> map, Object obj) { | |
| 59 | + if(map==null || obj==null){ | |
| 60 | + return null; | |
| 61 | + } | |
| 62 | + try { | |
| 63 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 64 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 65 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 66 | + String key = property.getName(); | |
| 67 | + if (map.containsKey(key)) { | |
| 68 | + Object value = map.get(key); | |
| 69 | + invokeIgnoreType(property,value,obj); | |
| 70 | + } | |
| 71 | + } | |
| 72 | + } catch (Exception e) { | |
| 73 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 74 | + System.err.println("transMap2Bean Error " + e); | |
| 75 | + e.printStackTrace(); | |
| 76 | + } | |
| 77 | + return obj; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public static Object transMap2AliasBean(Map<String, Object> map, Object obj, HashMap<String, String> keyMap) { | |
| 81 | + if(map==null || obj==null || keyMap==null){ | |
| 82 | + return null; | |
| 83 | + } | |
| 84 | + try { | |
| 85 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 86 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 87 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 88 | + String field = property.getName(); | |
| 89 | + if (keyMap.containsKey(field)) { | |
| 90 | + Object value = map.get(keyMap.get(field)); | |
| 91 | + invokeIgnoreType(property,value,obj); | |
| 92 | + } | |
| 93 | + } | |
| 94 | + } catch (Exception e) { | |
| 95 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 96 | + System.err.println("transMap2Bean Error " + e); | |
| 97 | + e.printStackTrace(); | |
| 98 | + } | |
| 99 | + return obj; | |
| 100 | + } | |
| 101 | + | |
| 102 | + // 自动处理时间字段和对应的字符串字段(Str结尾) | |
| 103 | + public static Object transMap2FormatBean(Map<String, Object> map, Object obj) { | |
| 104 | + if(map==null || obj==null){ | |
| 105 | + return null; | |
| 106 | + } | |
| 107 | + try { | |
| 108 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 109 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 110 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 111 | + String key = property.getName(); | |
| 112 | + Class<?> keyType = property.getPropertyType(); | |
| 113 | + // set当前字段 | |
| 114 | + if (map.containsKey(key)) { | |
| 115 | + Object value = map.get(key); | |
| 116 | + if(value==null){ | |
| 117 | + continue; | |
| 118 | + } | |
| 119 | + invokeIgnoreType(property,value,obj); | |
| 120 | + | |
| 121 | + /* | |
| 122 | + * 自动处理时间字段和对应的字符串字段(Str结尾) | |
| 123 | + */ | |
| 124 | + if (keyType.equals(String.class) && key.length() > 3 | |
| 125 | + && "Str".equals(key.substring(key.length() - 3))) {// key可能是格式化字段 | |
| 126 | + String dateKey = key.substring(0,key.length() - 3); | |
| 127 | + for (PropertyDescriptor dateProperty : propertyDescriptors) { | |
| 128 | + if (dateKey.equals(dateProperty.getName())) {// 找到了对应的日期字段,set之 | |
| 129 | + String dateValue = value.toString(); | |
| 130 | + if (dateValue.length() == 10) {// yyyy-MM-dd | |
| 131 | + dateProperty.getWriteMethod().invoke(obj, DateUtil.parseYMD(dateValue)); | |
| 132 | + } else if (dateValue.length() == 19) {// yyyy-MM-dd | |
| 133 | + // HH:mm:ss | |
| 134 | + dateProperty.getWriteMethod().invoke(obj, DateUtil.parseYMDHMS(dateValue)); | |
| 135 | + } | |
| 136 | + } | |
| 137 | + } | |
| 138 | + } | |
| 139 | + } | |
| 140 | + | |
| 141 | + } | |
| 142 | + } catch (Exception e) { | |
| 143 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 144 | + System.err.println("transMap2FormatBean Error " + e); | |
| 145 | + e.printStackTrace(); | |
| 146 | + } | |
| 147 | + return obj; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public static Map<String, Object> transBean2Map(Object obj) { | |
| 151 | + if(obj==null){ | |
| 152 | + return null; | |
| 153 | + } | |
| 154 | + Map<String, Object> map = new HashMap<>(); | |
| 155 | + try { | |
| 156 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 157 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 158 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 159 | + String key = property.getName(); | |
| 160 | + // 过滤class属性 | |
| 161 | + if (!key.equals("class")) { | |
| 162 | + // 得到property对应的getter方法 | |
| 163 | + Method getter = property.getReadMethod(); | |
| 164 | + Object value = getter.invoke(obj); | |
| 165 | + map.put(key, value); | |
| 166 | + } | |
| 167 | + } | |
| 168 | + } catch (Exception e) { | |
| 169 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 170 | + System.err.println("transBean2Map Error " + e); | |
| 171 | + e.printStackTrace(); | |
| 172 | + } | |
| 173 | + return map; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public static HashMap<String, String> getKeyMap(String[] original, String[] alias) { | |
| 177 | + int length = original.length; | |
| 178 | + if (length != alias.length) { | |
| 179 | + throw new RuntimeException("映射配置错误"); | |
| 180 | + } | |
| 181 | + HashMap<String, String> map = new HashMap<>(); | |
| 182 | + for (int i = 0; i < length; i++) { | |
| 183 | + map.put(original[i], alias[i]); | |
| 184 | + map.put(alias[i], original[i]); | |
| 185 | + } | |
| 186 | + /* | |
| 187 | + * 1--A(正常映射) 4--4(同名映射,允许) 2--C,C--3(错误映射) 错误的keyMap映射的value会有重复 | |
| 188 | + */ | |
| 189 | + Set<String> keySet = map.keySet(); | |
| 190 | + Set<String> valueSet = new HashSet<>(); | |
| 191 | + for (String key : keySet) { | |
| 192 | + valueSet.add(map.get(key)); | |
| 193 | + } | |
| 194 | + if (keySet.size() != valueSet.size()) { | |
| 195 | + throw new RuntimeException("映射配置错误"); | |
| 196 | + } | |
| 197 | + return map; | |
| 198 | + } | |
| 199 | + | |
| 200 | + public static Map<String, Object> transBean2AliasMap(Object obj, HashMap<String, String> keyMap) { | |
| 201 | + if(keyMap==null || obj==null){ | |
| 202 | + return null; | |
| 203 | + } | |
| 204 | + Map<String, Object> map = new HashMap<>(); | |
| 205 | + try { | |
| 206 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 207 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 208 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 209 | + String field = property.getName(); | |
| 210 | + // 过滤class属性 | |
| 211 | + if (!field.equals("class")) { | |
| 212 | + // 得到property对应的getter方法 | |
| 213 | + Method getter = property.getReadMethod(); | |
| 214 | + Object value = getter.invoke(obj); | |
| 215 | + if (keyMap.containsKey(field)) { | |
| 216 | + map.put(keyMap.get(field), value); | |
| 217 | + } | |
| 218 | + } | |
| 219 | + } | |
| 220 | + } catch (Exception e) { | |
| 221 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 222 | + System.err.println("transBean2AliasMap Error " + e); | |
| 223 | + e.printStackTrace(); | |
| 224 | + } | |
| 225 | + return map; | |
| 226 | + } | |
| 227 | + | |
| 228 | + public static Map<String, Object> transBean2FormatAliasMap(Object obj, HashMap<String, String> keyMap) { | |
| 229 | + if(keyMap==null || obj==null){ | |
| 230 | + return null; | |
| 231 | + } | |
| 232 | + Map<String, Object> map = new HashMap<>(); | |
| 233 | + try { | |
| 234 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 235 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 236 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 237 | + String field = property.getName(); | |
| 238 | + // Class<?> fieldType = property.getPropertyType(); | |
| 239 | + // 过滤class属性 | |
| 240 | + if (!field.equals("class")) { | |
| 241 | + // 得到property对应的getter方法 | |
| 242 | + Method getter = property.getReadMethod(); | |
| 243 | + Object value = getter.invoke(obj); | |
| 244 | + if (value instanceof Date) {// 自动格式化日期对象 | |
| 245 | + Date dateValue = (Date) value; | |
| 246 | + String str = DateUtil.getyyyy_MM_dd(dateValue);// getyyyy_MM_dd_hms | |
| 247 | + if (keyMap.get(field + "Str") != null) { | |
| 248 | + map.put(keyMap.get(field + "Str"), str); | |
| 249 | + } | |
| 250 | + } else {// 普通字段,别名存储 | |
| 251 | + if (keyMap.get(field) != null) { | |
| 252 | + if (map.get(keyMap.get(field)) == null) {// 如果被以上的格式化代码赋值过,则不再过问 | |
| 253 | + map.put(keyMap.get(field), value); | |
| 254 | + } | |
| 255 | + } | |
| 256 | + } | |
| 257 | + } | |
| 258 | + } | |
| 259 | + } catch (Exception e) { | |
| 260 | + System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 261 | + System.err.println("transBean2FormatAliasMap Error " + e); | |
| 262 | + e.printStackTrace(); | |
| 263 | + } | |
| 264 | + return map; | |
| 265 | + } | |
| 266 | + | |
| 267 | +// public static void mappingAlias(Object original, Object alias, HashMap<String, String> keyMap) { | |
| 268 | +// Map<String, Object> aliasMap = transBean2AliasMap(original, keyMap); | |
| 269 | +// transMap2Bean(aliasMap, alias); | |
| 270 | +// } | |
| 271 | +// | |
| 272 | +// public static void mappingFormatAlias(Object original, Object alias, HashMap<String, String> keyMap) { | |
| 273 | +// Map<String, Object> aliasMap = transBean2FormatAliasMap(original, keyMap); | |
| 274 | +// transMap2FormatBean(aliasMap, alias); | |
| 275 | +// } | |
| 276 | + | |
| 277 | + /* | |
| 278 | + * 方便书写映射文件keyMap | |
| 279 | + */ | |
| 280 | + private static void printField(Object obj) { | |
| 281 | + try { | |
| 282 | + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 283 | + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 284 | + for (PropertyDescriptor property : propertyDescriptors) { | |
| 285 | + String key = property.getName(); | |
| 286 | + // 过滤class属性 | |
| 287 | + if (!key.equals("class")) { | |
| 288 | + System.out.println("\"" + key + "\",//");// "name", | |
| 289 | + } | |
| 290 | + } | |
| 291 | + } catch (Exception e) { | |
| 292 | + e.printStackTrace(); | |
| 293 | + } | |
| 294 | + } | |
| 295 | + | |
| 296 | + /* | |
| 297 | + * 方便书写 json | |
| 298 | + */ | |
| 299 | + private static void printJsonByArray(String[] args) { | |
| 300 | + System.out.println("{"); | |
| 301 | + for (int i = 0; i < args.length; i++) { | |
| 302 | + String str = "\"" + args[i] + "\":\"666\""; | |
| 303 | + if (i != args.length - 1) { | |
| 304 | + str += ","; | |
| 305 | + } | |
| 306 | + System.out.println(str); | |
| 307 | + } | |
| 308 | + System.out.println("}"); | |
| 309 | + } | |
| 310 | + | |
| 311 | + public static void main(String[] args) { | |
| 312 | + printField(new DiagnoseAssit()); | |
| 313 | +// printJsonByArray(WomanFetationRecordKeymap.alias); | |
| 314 | + } | |
| 315 | + | |
| 316 | +} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java
View file @
91a052c
| 1 | 1 | package com.lyms.hospital.controller; |
| 2 | 2 | |
| 3 | 3 | import java.util.ArrayList; |
| 4 | +import java.util.Date; | |
| 4 | 5 | import java.util.HashMap; |
| 5 | 6 | import java.util.List; |
| 6 | 7 | import java.util.Map; |
| ... | ... | @@ -29,6 +30,7 @@ |
| 29 | 30 | * []查询病史配置<br> |
| 30 | 31 | * 查询省市区数据<br> |
| 31 | 32 | * 查询字典数据<br> |
| 33 | + * []获取当前服务器时间<br/> | |
| 32 | 34 | * |
| 33 | 35 | * @author xujiahong |
| 34 | 36 | * @since 2017-04-21 |
| ... | ... | @@ -41,6 +43,20 @@ |
| 41 | 43 | private RegionsService regionService; |
| 42 | 44 | @Autowired |
| 43 | 45 | private HistorySourceService historySourceService; |
| 46 | + | |
| 47 | + /** | |
| 48 | + * <li>@Description:获取当前服务器时间 | |
| 49 | + * <li>@return | |
| 50 | + * <li>创建人:xujiahong | |
| 51 | + * <li>创建时间:2017年5月8日 | |
| 52 | + * <li>修改人: | |
| 53 | + * <li>修改时间: | |
| 54 | + */ | |
| 55 | + @RequestMapping(value = "/cTime", method = RequestMethod.GET) | |
| 56 | + @ResponseBody | |
| 57 | + public AjaxResult queryCurrentTime() { | |
| 58 | + return AjaxResult.returnSuccess(new Date().getTime()); | |
| 59 | + } | |
| 44 | 60 | |
| 45 | 61 | /** |
| 46 | 62 | * <li>@Description:查询病史配置 |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthController.java
View file @
91a052c
| 1 | +package com.lyms.hospital.controller.childbirth; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Controller; | |
| 10 | +import org.springframework.util.StringUtils; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 13 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 14 | + | |
| 15 | +import com.lyms.base.common.entity.user.Users; | |
| 16 | +import com.lyms.base.common.service.organ.OrganizationsService; | |
| 17 | +import com.lyms.hospital.entity.childbirth.ChildbirthInfo; | |
| 18 | +import com.lyms.hospital.entity.woman.WomanFetationRecord; | |
| 19 | +import com.lyms.hospital.request.exam.ChildbirthAddRequest; | |
| 20 | +import com.lyms.hospital.service.childbirth.ChildbirthInfoService; | |
| 21 | +import com.lyms.hospital.service.woman.WomanFetationRecordService; | |
| 22 | +import com.lyms.shiro.ShiroWebUtils; | |
| 23 | +import com.lyms.util.DateUtil; | |
| 24 | +import com.lyms.web.bean.AjaxResult; | |
| 25 | +import com.lyms.web.controller.BaseController; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * <p> | |
| 29 | + * 分娩-前端控制器 | |
| 30 | + * </p> | |
| 31 | + * 保存分娩记录<br/> | |
| 32 | + * []依据cardNo或vcCardNo查询孕妇分娩记录<br/> | |
| 33 | + * | |
| 34 | + * @author xujiahong | |
| 35 | + * @since 2017-03-31 | |
| 36 | + */ | |
| 37 | +@Controller | |
| 38 | +@RequestMapping("/childbirth") | |
| 39 | +public class ChildbirthController extends BaseController { | |
| 40 | + | |
| 41 | + @Autowired | |
| 42 | + private WomanFetationRecordService fetationService; | |
| 43 | + @Autowired | |
| 44 | + private ChildbirthInfoService birthService; | |
| 45 | + @Autowired | |
| 46 | + private OrganizationsService orgService; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * <li>@Description:保存分娩记录 | |
| 50 | + * <li>@param cardNo | |
| 51 | + * <li>@param vcCardNo | |
| 52 | + * <li>@return | |
| 53 | + * <li>创建人:xujiahong | |
| 54 | + * <li>创建时间:2017年5月8日 | |
| 55 | + * <li>修改人: | |
| 56 | + * <li>修改时间: | |
| 57 | + */ | |
| 58 | + @RequestMapping(value = "/matdel", method = RequestMethod.POST) | |
| 59 | + @ResponseBody | |
| 60 | + public AjaxResult saveChildbirthVo(ChildbirthAddRequest request) { | |
| 61 | + return AjaxResult.returnFail(); | |
| 62 | + } | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * <li>@Description:依据cardNo或vcCardNo查询孕妇分娩记录 | |
| 66 | + * <li>@param cardNo | |
| 67 | + * <li>@param vcCardNo | |
| 68 | + * <li>@return | |
| 69 | + * <li>创建人:xujiahong | |
| 70 | + * <li>创建时间:2017年5月8日 | |
| 71 | + * <li>修改人: | |
| 72 | + * <li>修改时间: | |
| 73 | + */ | |
| 74 | + @RequestMapping(value = "/matmanger", method = RequestMethod.GET) | |
| 75 | + @ResponseBody | |
| 76 | + public AjaxResult selectChildbirthHistory(String cardNo, String vcCardNo) { | |
| 77 | + // 基本验证 | |
| 78 | + Users users = ShiroWebUtils.getCurrentUser(); | |
| 79 | + String orgId = users.getOrgId(); | |
| 80 | + if (StringUtils.isEmpty(orgId)) { | |
| 81 | + return AjaxResult.returnFail("入参错误:医院ID为空"); | |
| 82 | + } | |
| 83 | + if (StringUtils.isEmpty(cardNo) && StringUtils.isEmpty(vcCardNo)) { | |
| 84 | + return AjaxResult.returnFail("入参错误:查询条件为空"); | |
| 85 | + } | |
| 86 | + // 组装返回对象-查询孕妇建档信息 | |
| 87 | + Map<String, Object> dataMap = fetationService.selectTopFetationInfo(cardNo, vcCardNo, orgId); | |
| 88 | + // 未查询到孕妇建档信息 | |
| 89 | + if (dataMap == null) { | |
| 90 | + return AjaxResult.returnSuccess(null);// 将基本的对象返回空 | |
| 91 | + } | |
| 92 | + WomanFetationRecord dbFetationRecord = (WomanFetationRecord)dataMap.get("dbFetationRecord"); | |
| 93 | + | |
| 94 | + //TODO 满固定孕周才可以分娩 | |
| 95 | + | |
| 96 | + // 分娩记录列表 | |
| 97 | + List<Map<String, Object>> data = new ArrayList<>(); // data 系前端指定名称 | |
| 98 | + List<ChildbirthInfo> birthList = birthService.selectListByWomanId(dbFetationRecord.getId()); | |
| 99 | + if(birthList!=null && !birthList.isEmpty()){ | |
| 100 | + for(ChildbirthInfo info : birthList){ | |
| 101 | + Map<String, Object> map = new HashMap<>(); | |
| 102 | + map.put("hospitalName", orgService.getNameById(info.getOrgId())); | |
| 103 | + map.put("hospitalId", info.getOrgId()); | |
| 104 | + map.put("id", info.getId()); | |
| 105 | + map.put("checkTime", DateUtil.getyyyy_MM_dd(info.getChildbirthTime())); | |
| 106 | + map.put("enableEdit", 1); | |
| 107 | + data.add(map); | |
| 108 | + } | |
| 109 | + } | |
| 110 | + | |
| 111 | + dataMap.put("data", data);//分娩记录列表 | |
| 112 | + dataMap.remove("dbFetationRecord"); | |
| 113 | + return AjaxResult.returnSuccess(dataMap); | |
| 114 | + } | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | +} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthInfoController.java
View file @
91a052c
| 1 | -package com.lyms.hospital.controller.childbirth; | |
| 2 | - | |
| 3 | -import org.springframework.stereotype.Controller; | |
| 4 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 5 | -import com.lyms.web.controller.BaseController; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * <p> | |
| 9 | - * 前端控制器 | |
| 10 | - * </p> | |
| 11 | - * | |
| 12 | - * @author xujiahong | |
| 13 | - * @since 2017-03-31 | |
| 14 | - */ | |
| 15 | -@Controller | |
| 16 | -@RequestMapping("/childbirthInfo") | |
| 17 | -public class ChildbirthInfoController extends BaseController { | |
| 18 | - | |
| 19 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthNewbornController.java
View file @
91a052c
| 1 | -package com.lyms.hospital.controller.childbirth; | |
| 2 | - | |
| 3 | -import org.springframework.stereotype.Controller; | |
| 4 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 5 | -import com.lyms.web.controller.BaseController; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * <p> | |
| 9 | - * 前端控制器 | |
| 10 | - * </p> | |
| 11 | - * | |
| 12 | - * @author xujiahong | |
| 13 | - * @since 2017-03-31 | |
| 14 | - */ | |
| 15 | -@Controller | |
| 16 | -@RequestMapping("/childbirthNewborn") | |
| 17 | -public class ChildbirthNewbornController extends BaseController { | |
| 18 | - | |
| 19 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthTaiController.java
View file @
91a052c
| 1 | -package com.lyms.hospital.controller.childbirth; | |
| 2 | - | |
| 3 | -import org.springframework.stereotype.Controller; | |
| 4 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 5 | -import com.lyms.web.controller.BaseController; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * <p> | |
| 9 | - * 前端控制器 | |
| 10 | - * </p> | |
| 11 | - * | |
| 12 | - * @author xujiahong | |
| 13 | - * @since 2017-03-31 | |
| 14 | - */ | |
| 15 | -@Controller | |
| 16 | -@RequestMapping("/childbirthTai") | |
| 17 | -public class ChildbirthTaiController extends BaseController { | |
| 18 | - | |
| 19 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/childbirth/ChildbirthTaipanController.java
View file @
91a052c
| 1 | -package com.lyms.hospital.controller.childbirth; | |
| 2 | - | |
| 3 | -import org.springframework.stereotype.Controller; | |
| 4 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 5 | -import com.lyms.web.controller.BaseController; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * <p> | |
| 9 | - * 前端控制器 | |
| 10 | - * </p> | |
| 11 | - * | |
| 12 | - * @author xujiahong | |
| 13 | - * @since 2017-03-31 | |
| 14 | - */ | |
| 15 | -@Controller | |
| 16 | -@RequestMapping("/childbirthTaipan") | |
| 17 | -public class ChildbirthTaipanController extends BaseController { | |
| 18 | - | |
| 19 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java
View file @
91a052c
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import java.util.List; |
| 7 | 7 | import java.util.Map; |
| 8 | 8 | |
| 9 | +import org.apache.commons.collections.CollectionUtils; | |
| 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 11 | import org.springframework.stereotype.Controller; |
| 11 | 12 | import org.springframework.util.StringUtils; |
| ... | ... | @@ -14,6 +15,10 @@ |
| 14 | 15 | import org.springframework.web.bind.annotation.RequestMethod; |
| 15 | 16 | import org.springframework.web.bind.annotation.ResponseBody; |
| 16 | 17 | |
| 18 | +import com.lyms.base.common.entity.organ.Organizations; | |
| 19 | +import com.lyms.base.common.entity.user.Users; | |
| 20 | +import com.lyms.base.common.service.organ.OrganizationsService; | |
| 21 | +import com.lyms.base.common.service.user.UsersService; | |
| 17 | 22 | import com.lyms.hospital.entity.assist.DiagnoseAssit; |
| 18 | 23 | import com.lyms.hospital.entity.diagnose.DiagnoseInfo; |
| 19 | 24 | import com.lyms.hospital.entity.diagnose.DiagnoseTai; |
| 20 | 25 | |
| ... | ... | @@ -30,9 +35,11 @@ |
| 30 | 35 | import com.lyms.hospital.service.diagnose.DiagnoseInfoService; |
| 31 | 36 | import com.lyms.hospital.service.diagnose.DiagnoseTaiService; |
| 32 | 37 | import com.lyms.hospital.service.history.HistoryMapsService; |
| 33 | -import com.lyms.hospital.service.token.TokenService; | |
| 34 | 38 | import com.lyms.hospital.service.woman.WomanFetationRecordService; |
| 35 | 39 | import com.lyms.hospital.util.HospitalUtil; |
| 40 | +import com.lyms.hospital.util.UnitConstants; | |
| 41 | +import com.lyms.hospital.util.trans.XjhMapUtil; | |
| 42 | +import com.lyms.shiro.ShiroWebUtils; | |
| 36 | 43 | import com.lyms.util.DateUtil; |
| 37 | 44 | import com.lyms.web.bean.AjaxResult; |
| 38 | 45 | import com.lyms.web.controller.BaseController; |
| 39 | 46 | |
| ... | ... | @@ -42,9 +49,10 @@ |
| 42 | 49 | * |
| 43 | 50 | * [--]依据cardNo或vcCardNo查询孕妇产检记录 <br> |
| 44 | 51 | * [--]保存初诊数据 <br> |
| 45 | - * 保存复诊数据 <br> | |
| 46 | - * 查询某条记录的详细信息,用于表单填写<br> | |
| 52 | + * [--]保存复诊数据 <br> | |
| 53 | + * [--]查询某条记录的详细信息,用于表单填写<br> | |
| 47 | 54 | * [--]产检获取字典数据<br> |
| 55 | + * [--]初诊查看页面数据<br> | |
| 48 | 56 | * |
| 49 | 57 | * @author xujiahong |
| 50 | 58 | * |
| 51 | 59 | |
| ... | ... | @@ -64,9 +72,148 @@ |
| 64 | 72 | @Autowired |
| 65 | 73 | private HistoryMapsService historyMapsService; |
| 66 | 74 | @Autowired |
| 67 | - private TokenService tokenService; | |
| 68 | - | |
| 75 | + private UsersService usersService; | |
| 76 | + @Autowired | |
| 77 | + private OrganizationsService orgService; | |
| 78 | + | |
| 69 | 79 | /** |
| 80 | + * <li>@Description:初诊查看页面数据 | |
| 81 | + * <li>@param id | |
| 82 | + * <li>@param type | |
| 83 | + * <li>@return | |
| 84 | + * <li>创建人:xujiahong | |
| 85 | + * <li>创建时间:2017年5月6日 | |
| 86 | + * <li>修改人: | |
| 87 | + * <li>修改时间: | |
| 88 | + */ | |
| 89 | + @RequestMapping(value = "/findAntExChuData", method = RequestMethod.GET) | |
| 90 | + @ResponseBody | |
| 91 | + public AjaxResult selectFirstExamData(String id) { | |
| 92 | + /* | |
| 93 | + * 产检基础信息、产检辅助信息、病史列表、胎儿列表、诊断列表 TODO | |
| 94 | + */ | |
| 95 | + DiagnoseInfo info = infoService.selectById(id);// 产检基础信息 | |
| 96 | + if (info == null) { | |
| 97 | + return AjaxResult.returnSuccess(); | |
| 98 | + } | |
| 99 | + DiagnoseAssit assist = assistService.getDetailByDiagnoseInfo(info.getId(), DiagnoseAssit.DIAGNOSE_TYPE_BIRTH);// 诊断类型:1婚前检查,【2产检】,3儿保检查 | |
| 100 | + List<HistoryMaps> historyMapsList = historyMapsService.getListByTarget(info.getId(), | |
| 101 | + HistoryMaps.TARGET_TYPE_EXAM);// 关联目标类型:1产检、2妇女建档 | |
| 102 | + List<DiagnoseTai> diagnoseTaiList = diagnoseTaiService.getListByExamId(info.getId()); | |
| 103 | + ExamAddRequestWrapper wrapper = new ExamAddRequestWrapper(info, assist, historyMapsList, diagnoseTaiList); | |
| 104 | + // 查询孕妇基本信息 | |
| 105 | + WomanFetationRecord womanFetation = fetationService.selectById(info.getWomanId()); | |
| 106 | + | |
| 107 | + ExamAddRequest result = wrapper.getExamAddRequest(); | |
| 108 | + Map<String, Object> map = XjhMapUtil.transBean2Map(result);// 返回数据 | |
| 109 | + | |
| 110 | + // 孕妇基本信息 | |
| 111 | + map.put("id", womanFetation.getId()); | |
| 112 | + map.put("username", womanFetation.getBaseWomanName()); | |
| 113 | + map.put("birth", DateUtil.getyyyy_MM_dd(womanFetation.getBaseWomanBirth())); | |
| 114 | + map.put("age", UnitConstants.splice(DateUtil.getAge(womanFetation.getBaseWomanBirth()), UnitConstants.SUI)); | |
| 115 | + map.put("phone", womanFetation.getContactWomanWay()); | |
| 116 | + | |
| 117 | + // 基本信息孕周 | |
| 118 | + // map.put("fmWeek", patients.getPhone());之前老接口返回的电话号码。。。看字段是 分娩孕周 | |
| 119 | + map.put("dueDate", DateUtil.getyyyy_MM_dd(womanFetation.getHospitalExpectedDate()));// 预产期 | |
| 120 | + map.put("mremark", womanFetation.getHospitalRecordRemark()); | |
| 121 | + | |
| 122 | + // 产检孕周 | |
| 123 | + map.put("cDueWeek", HospitalUtil.getPregnantWeek(womanFetation.getHospitalCorrectLastMenstruation(), | |
| 124 | + info.getDiagnoseTime())); | |
| 125 | + // 产检医生 | |
| 126 | + Users users = usersService.selectById(info.getDoctorId()); | |
| 127 | + if (users != null) { | |
| 128 | + map.put("checkDoctor", users.getName()); | |
| 129 | + } | |
| 130 | + // 产检医院 | |
| 131 | + Organizations org = orgService.selectById(info.getOrgId()); | |
| 132 | + if (org != null) { | |
| 133 | + map.put("hospital", org.getName()); | |
| 134 | + } | |
| 135 | + | |
| 136 | + // 下次检查时间 | |
| 137 | + map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(info.getNextinspectTime())); | |
| 138 | + // 下次检查孕周 | |
| 139 | + map.put("nextCheckWeek", HospitalUtil.getPregnantWeek(womanFetation.getHospitalCorrectLastMenstruation(), | |
| 140 | + info.getNextinspectTime())); | |
| 141 | + // 孕产史 | |
| 142 | + map.put("pregnancyTimes", UnitConstants.splice(result.getPregnancyTimes(), UnitConstants.CI)); | |
| 143 | + map.put("prodTime", UnitConstants.splice(result.getProdTime(), UnitConstants.CI)); | |
| 144 | + map.put("delivery", UnitConstants.splice(result.getDelivery(), UnitConstants.CI)); | |
| 145 | + map.put("planedProd", UnitConstants.splice(result.getPlanedProd(), UnitConstants.CI)); | |
| 146 | + // 流产 | |
| 147 | + String abortion = ""; | |
| 148 | + abortion = UnitConstants.splice(result.getAbortion(), UnitConstants.CI) == null ? "" | |
| 149 | + : UnitConstants.splice(result.getAbortion(), UnitConstants.CI); | |
| 150 | + if (result.getAbortionZR() != null && result.getAbortionRG() != null) { | |
| 151 | + abortion += "(自然:" + result.getAbortionZR() + UnitConstants.CI + " 人工:" + result.getAbortionRG() | |
| 152 | + + UnitConstants.CI + ")"; | |
| 153 | + } | |
| 154 | + map.put("abortion", abortion); | |
| 155 | + map.put("stillbirth", UnitConstants.splice(result.getStillbirth(), UnitConstants.CI)); | |
| 156 | + map.put("stillChan", UnitConstants.splice(result.getStillChan(), UnitConstants.CI)); | |
| 157 | + map.put("neoDeath", UnitConstants.splice(result.getNeoDeath(), UnitConstants.CI)); | |
| 158 | + map.put("birthDefect", UnitConstants.splice(result.getBirthDefect(), UnitConstants.CI)); | |
| 159 | + | |
| 160 | + map.put("height", UnitConstants.splice(result.getHeight(), UnitConstants.CM)); | |
| 161 | + map.put("weight", UnitConstants.splice(result.getWeight(), UnitConstants.KG)); | |
| 162 | + map.put("yqWeight", UnitConstants.splice(result.getYqWeight(), UnitConstants.KG)); | |
| 163 | + // 血压 | |
| 164 | + String ssy = info.getBloodShrink() == null ? "" : info.getBloodShrink() + ""; | |
| 165 | + String szy = info.getBloodDiastole() == null ? "" : info.getBloodDiastole() + ""; | |
| 166 | + map.put("bp", UnitConstants.splice(ssy + "/" + szy, UnitConstants.MMHG)); | |
| 167 | + | |
| 168 | + map.put("gonggao", UnitConstants.splice(result.getGonggao(), UnitConstants.CM)); | |
| 169 | + map.put("fuwei", UnitConstants.splice(result.getFuwei(), UnitConstants.CM)); | |
| 170 | + | |
| 171 | + // 胎儿情况 | |
| 172 | + | |
| 173 | + | |
| 174 | + /* 辅助检查 */ | |
| 175 | + map.put("xhdb",UnitConstants.splice(result.getXhdb(),UnitConstants.GL)); | |
| 176 | + map.put("bxbjs",UnitConstants.splice(result.getBxbjs(),UnitConstants.TEN_LKG)); | |
| 177 | + map.put("platelet",UnitConstants.splice(result.getPlatelet(),UnitConstants.TEN_LKG)); | |
| 178 | + | |
| 179 | + map.put("bloodSugar",UnitConstants.splice(result.getBloodSugar(),UnitConstants.MMOLL)); | |
| 180 | + map.put("xqgbzam",UnitConstants.splice(result.getXqgbzam(), UnitConstants.UL)); | |
| 181 | + map.put("xqgczam",UnitConstants.splice(result.getXqgczam(), UnitConstants.UL)); | |
| 182 | + map.put("albumin",UnitConstants.splice(result.getAlbumin(), UnitConstants.GL)); | |
| 183 | + map.put("totalBilirubin",UnitConstants.splice(result.getTotalBilirubin(), UnitConstants.UMOLL)); | |
| 184 | + map.put("jhBilirubin",UnitConstants.splice(result.getJhBilirubin(), UnitConstants.UMOLL)); | |
| 185 | + | |
| 186 | + map.put("xqjq",UnitConstants.splice(result.getXqjq(), UnitConstants.UL)); | |
| 187 | + map.put("xnsd",UnitConstants.splice(result.getXnsd(), UnitConstants.UL)); | |
| 188 | + | |
| 189 | + return AjaxResult.returnSuccess(map); | |
| 190 | + } | |
| 191 | + | |
| 192 | + /** | |
| 193 | + * <li>@Description:保存复诊数据 | |
| 194 | + * <li>@param request | |
| 195 | + * <li>@return | |
| 196 | + * <li>创建人:xujiahong | |
| 197 | + * <li>创建时间:2017年5月5日 | |
| 198 | + * <li>修改人: | |
| 199 | + * <li>修改时间: | |
| 200 | + */ | |
| 201 | + @RequestMapping(value = "/antexmanage", method = RequestMethod.POST) | |
| 202 | + @ResponseBody | |
| 203 | + public AjaxResult saveLaterExam(@RequestBody ExamAddRequest request) { | |
| 204 | + /* | |
| 205 | + * (1)保存产检基本信息 (2)多个胎儿信息(3) 多个诊断信息 TODO | |
| 206 | + */ | |
| 207 | + // 对象转换 | |
| 208 | + ExamAddRequestWrapper wrapper = new ExamAddRequestWrapper(request); | |
| 209 | + DiagnoseInfo info = wrapper.getDiagnoseInfo(); | |
| 210 | + List<DiagnoseTai> taiList = wrapper.getDiagnoseTaiList(); // 胎儿信息 | |
| 211 | + // 保存初诊信息 | |
| 212 | + String result = infoService.saveLaterExam(info, taiList); | |
| 213 | + return "success".equals(result) ? AjaxResult.returnSuccess() : AjaxResult.returnFail(result); | |
| 214 | + } | |
| 215 | + | |
| 216 | + /** | |
| 70 | 217 | * <li>@Description:产检获取字典数据 |
| 71 | 218 | * <li>@return |
| 72 | 219 | * <li>创建人:xujiahong |
| 73 | 220 | |
| 74 | 221 | |
| 75 | 222 | |
| 76 | 223 | |
| 77 | 224 | |
| 78 | 225 | |
| 79 | 226 | |
| 80 | 227 | |
| 81 | 228 | |
| 82 | 229 | |
| 83 | 230 | |
| 84 | 231 | |
| 85 | 232 | |
| 86 | 233 | |
| 87 | 234 | |
| 88 | 235 | |
| 89 | 236 | |
| 90 | 237 | |
| 91 | 238 | |
| 92 | 239 | |
| ... | ... | @@ -78,130 +225,153 @@ |
| 78 | 225 | @RequestMapping(value = "/antex/getenums", method = RequestMethod.GET) |
| 79 | 226 | @ResponseBody |
| 80 | 227 | public AjaxResult getDictionary() { |
| 81 | - Map<String,Object> data = new HashMap<>(); | |
| 82 | - //枚举常量======================================= | |
| 83 | - //getFetal 胎先露 | |
| 228 | + Map<String, Object> data = new HashMap<>(); | |
| 229 | + // 枚举常量======================================= | |
| 230 | + // getFetal 胎先露 | |
| 84 | 231 | data.put("getFetal", FetalEnums.getList()); |
| 85 | - //getJoin 衔接 | |
| 232 | + // getJoin 衔接 | |
| 86 | 233 | data.put("getJoin", JoinEnums.getList()); |
| 87 | - //fuzhong ? | |
| 234 | + // fuzhong ? | |
| 88 | 235 | data.put("fuzhong", FuZhongEnums.getList()); |
| 89 | - //getTaiPan 胎盘个数 | |
| 236 | + // getTaiPan 胎盘个数 | |
| 90 | 237 | data.put("getTaiPan", TaiShuEnums.TaiPanEnums.getList()); |
| 91 | - //getTaiShu 胎数 | |
| 238 | + // getTaiShu 胎数 | |
| 92 | 239 | data.put("getTaiShu", TaiShuEnums.getList()); |
| 93 | - //getFetPosition | |
| 240 | + // getFetPosition | |
| 94 | 241 | data.put("getFetPosition", FetalPositionEnums.getList()); |
| 95 | - //字典常量======================================= | |
| 96 | - //xx 血型-模拟数据 TODO | |
| 97 | - List<Map<String,Object>> xx = new ArrayList<>(); | |
| 98 | - Map<String,Object> xx_map1 = new HashMap<String,Object>(){{ | |
| 99 | - put("id", "xxa"); | |
| 100 | - put("parentId", "5769eef90cf22c315757741f"); | |
| 101 | - put("name", "A"); | |
| 102 | - }}; | |
| 242 | + // 字典常量======================================= | |
| 243 | + // xx 血型-模拟数据 TODO | |
| 244 | + List<Map<String, Object>> xx = new ArrayList<>(); | |
| 245 | + Map<String, Object> xx_map1 = new HashMap<String, Object>() { | |
| 246 | + { | |
| 247 | + put("id", "xxa"); | |
| 248 | + put("parentId", "5769eef90cf22c315757741f"); | |
| 249 | + put("name", "A"); | |
| 250 | + } | |
| 251 | + }; | |
| 103 | 252 | xx.add(xx_map1); |
| 104 | - Map<String,Object> xx_map2 = new HashMap<String,Object>(){{ | |
| 105 | - put("id", "xxb"); | |
| 106 | - put("parentId", "5769eef90cf22c315757741f"); | |
| 107 | - put("name", "B"); | |
| 108 | - }}; | |
| 253 | + Map<String, Object> xx_map2 = new HashMap<String, Object>() { | |
| 254 | + { | |
| 255 | + put("id", "xxb"); | |
| 256 | + put("parentId", "5769eef90cf22c315757741f"); | |
| 257 | + put("name", "B"); | |
| 258 | + } | |
| 259 | + }; | |
| 109 | 260 | xx.add(xx_map2); |
| 110 | 261 | data.put("xx", xx); |
| 111 | - | |
| 112 | - //getHighRisk 高危标签-模拟数据 TODO | |
| 113 | - List<Map<String,Object>> getHighRisk = new ArrayList<>(); | |
| 114 | - Map<String,Object> getHighRisk_map1 = new HashMap<String,Object>(){{ | |
| 115 | - put("id", "meidu"); | |
| 116 | - put("parentId", "224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 117 | - put("code", "10"); | |
| 118 | - put("name", "梅毒"); | |
| 119 | - put("typeId","fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 120 | - put("color","risk_purple"); | |
| 121 | - put("yn","1"); | |
| 122 | - }}; | |
| 262 | + | |
| 263 | + // getHighRisk 高危标签-模拟数据 TODO | |
| 264 | + List<Map<String, Object>> getHighRisk = new ArrayList<>(); | |
| 265 | + Map<String, Object> getHighRisk_map1 = new HashMap<String, Object>() { | |
| 266 | + { | |
| 267 | + put("id", "meidu"); | |
| 268 | + put("parentId", "224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 269 | + put("code", "10"); | |
| 270 | + put("name", "梅毒"); | |
| 271 | + put("typeId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 272 | + put("color", "risk_purple"); | |
| 273 | + put("yn", "1"); | |
| 274 | + } | |
| 275 | + }; | |
| 123 | 276 | getHighRisk.add(getHighRisk_map1); |
| 124 | - Map<String,Object> getHighRisk_map2 = new HashMap<String,Object>(){{ | |
| 125 | - put("id", "hiv"); | |
| 126 | - put("parentId", "224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 127 | - put("code", "10"); | |
| 128 | - put("name", "HIV"); | |
| 129 | - put("typeId","fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 130 | - put("color","risk_purple"); | |
| 131 | - put("yn","1"); | |
| 132 | - }}; | |
| 277 | + Map<String, Object> getHighRisk_map2 = new HashMap<String, Object>() { | |
| 278 | + { | |
| 279 | + put("id", "hiv"); | |
| 280 | + put("parentId", "224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 281 | + put("code", "10"); | |
| 282 | + put("name", "HIV"); | |
| 283 | + put("typeId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 284 | + put("color", "risk_purple"); | |
| 285 | + put("yn", "1"); | |
| 286 | + } | |
| 287 | + }; | |
| 133 | 288 | getHighRisk.add(getHighRisk_map2); |
| 134 | 289 | data.put("getHighRisk", getHighRisk); |
| 135 | - | |
| 136 | - //gwfz 高危分值(高危等级-->评分)-模拟数据 TODO | |
| 137 | - List<Map<String,Object>> gwfz = new ArrayList<>(); | |
| 138 | - Map<String,Object> gwfz_map1 = new HashMap<String,Object>(){{ | |
| 139 | - put("id", "5769f0640cf2d37f034793a2"); | |
| 140 | - put("parentId", "5769eef90cf22c3157577422"); | |
| 141 | - put("name", "5"); | |
| 142 | - }}; | |
| 290 | + | |
| 291 | + // gwfz 高危分值(高危等级-->评分)-模拟数据 TODO | |
| 292 | + List<Map<String, Object>> gwfz = new ArrayList<>(); | |
| 293 | + Map<String, Object> gwfz_map1 = new HashMap<String, Object>() { | |
| 294 | + { | |
| 295 | + put("id", "5769f0640cf2d37f034793a2"); | |
| 296 | + put("parentId", "5769eef90cf22c3157577422"); | |
| 297 | + put("name", "5"); | |
| 298 | + } | |
| 299 | + }; | |
| 143 | 300 | gwfz.add(gwfz_map1); |
| 144 | - Map<String,Object> gwfz_map2 = new HashMap<String,Object>(){{ | |
| 145 | - put("id", "5769f0640cf2d37f034793a3"); | |
| 146 | - put("parentId", "5769eef90cf22c3157577422"); | |
| 147 | - put("name", "10"); | |
| 148 | - }}; | |
| 301 | + Map<String, Object> gwfz_map2 = new HashMap<String, Object>() { | |
| 302 | + { | |
| 303 | + put("id", "5769f0640cf2d37f034793a3"); | |
| 304 | + put("parentId", "5769eef90cf22c3157577422"); | |
| 305 | + put("name", "10"); | |
| 306 | + } | |
| 307 | + }; | |
| 149 | 308 | gwfz.add(gwfz_map2); |
| 150 | 309 | data.put("gwfz", gwfz); |
| 151 | - | |
| 152 | - //ydqjd 阴道清洁度-模拟数据 TODO | |
| 153 | - List<Map<String,Object>> ydqjd = new ArrayList<>(); | |
| 154 | - Map<String,Object> ydqjd_map1 = new HashMap<String,Object>(){{ | |
| 155 | - put("id", "5769ef930cf2d37f03479387"); | |
| 156 | - put("parentId", "5769eef90cf22c3157577420"); | |
| 157 | - put("name", "Ⅰ度"); | |
| 158 | - }}; | |
| 310 | + | |
| 311 | + // ydqjd 阴道清洁度-模拟数据 TODO | |
| 312 | + List<Map<String, Object>> ydqjd = new ArrayList<>(); | |
| 313 | + Map<String, Object> ydqjd_map1 = new HashMap<String, Object>() { | |
| 314 | + { | |
| 315 | + put("id", "5769ef930cf2d37f03479387"); | |
| 316 | + put("parentId", "5769eef90cf22c3157577420"); | |
| 317 | + put("name", "Ⅰ度"); | |
| 318 | + } | |
| 319 | + }; | |
| 159 | 320 | ydqjd.add(ydqjd_map1); |
| 160 | - Map<String,Object> ydqjd_map2 = new HashMap<String,Object>(){{ | |
| 161 | - put("id", "5769ef930cf2d37f03479390"); | |
| 162 | - put("parentId", "5769eef90cf22c3157577420"); | |
| 163 | - put("name", "Ⅱ度"); | |
| 164 | - }}; | |
| 321 | + Map<String, Object> ydqjd_map2 = new HashMap<String, Object>() { | |
| 322 | + { | |
| 323 | + put("id", "5769ef930cf2d37f03479390"); | |
| 324 | + put("parentId", "5769eef90cf22c3157577420"); | |
| 325 | + put("name", "Ⅱ度"); | |
| 326 | + } | |
| 327 | + }; | |
| 165 | 328 | ydqjd.add(ydqjd_map2); |
| 166 | 329 | data.put("ydqjd", ydqjd); |
| 167 | - | |
| 168 | - //organizations 组织机构-模拟数据 TODO | |
| 169 | - List<Map<String,Object>> organizations = new ArrayList<>(); | |
| 170 | - Map<String,Object> organizations_map1 = new HashMap<String,Object>(){{ | |
| 171 | - put("id", "193"); | |
| 172 | - put("name", "青龙妇幼保健院"); | |
| 173 | - }}; | |
| 330 | + | |
| 331 | + // organizations 组织机构-模拟数据 TODO | |
| 332 | + List<Map<String, Object>> organizations = new ArrayList<>(); | |
| 333 | + Map<String, Object> organizations_map1 = new HashMap<String, Object>() { | |
| 334 | + { | |
| 335 | + put("id", "193"); | |
| 336 | + put("name", "青龙妇幼保健院"); | |
| 337 | + } | |
| 338 | + }; | |
| 174 | 339 | organizations.add(organizations_map1); |
| 175 | - Map<String,Object> organizations_map2 = new HashMap<String,Object>(){{ | |
| 176 | - put("id", "195"); | |
| 177 | - put("name", "昌黎妇幼保健院"); | |
| 178 | - }}; | |
| 340 | + Map<String, Object> organizations_map2 = new HashMap<String, Object>() { | |
| 341 | + { | |
| 342 | + put("id", "195"); | |
| 343 | + put("name", "昌黎妇幼保健院"); | |
| 344 | + } | |
| 345 | + }; | |
| 179 | 346 | organizations.add(organizations_map2); |
| 180 | 347 | data.put("organizations", organizations); |
| 181 | - | |
| 182 | - //fxys 风险颜色-模拟数据 TODO | |
| 183 | - List<Map<String,Object>> fxys = new ArrayList<>(); | |
| 184 | - Map<String,Object> fxys_map1 = new HashMap<String,Object>(){{ | |
| 185 | - put("id", "zsyj"); | |
| 186 | - put("parentId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 187 | - put("name", "紫色预警"); | |
| 188 | - }}; | |
| 348 | + | |
| 349 | + // fxys 风险颜色-模拟数据 TODO | |
| 350 | + List<Map<String, Object>> fxys = new ArrayList<>(); | |
| 351 | + Map<String, Object> fxys_map1 = new HashMap<String, Object>() { | |
| 352 | + { | |
| 353 | + put("id", "zsyj"); | |
| 354 | + put("parentId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 355 | + put("name", "紫色预警"); | |
| 356 | + } | |
| 357 | + }; | |
| 189 | 358 | fxys.add(fxys_map1); |
| 190 | - Map<String,Object> fxys_map2 = new HashMap<String,Object>(){{ | |
| 191 | - put("id", "csyj"); | |
| 192 | - put("parentId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 193 | - put("name", "橙色预警"); | |
| 194 | - }}; | |
| 359 | + Map<String, Object> fxys_map2 = new HashMap<String, Object>() { | |
| 360 | + { | |
| 361 | + put("id", "csyj"); | |
| 362 | + put("parentId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 363 | + put("name", "橙色预警"); | |
| 364 | + } | |
| 365 | + }; | |
| 195 | 366 | fxys.add(fxys_map2); |
| 196 | 367 | data.put("fxys", fxys); |
| 197 | - | |
| 198 | - //cTime | |
| 368 | + | |
| 369 | + // cTime | |
| 199 | 370 | data.put("cTime", DateUtil.getyyyy_MM_dd(new Date())); |
| 200 | - //now | |
| 371 | + // now | |
| 201 | 372 | data.put("now", DateUtil.getyyyy_MM_dd(new Date())); |
| 202 | 373 | return AjaxResult.returnSuccess(data); |
| 203 | 374 | } |
| 204 | - | |
| 205 | 375 | |
| 206 | 376 | /** |
| 207 | 377 | * <li>@Description:查询某条记录的详细信息,用于表单填写 |
| ... | ... | @@ -224,11 +394,11 @@ |
| 224 | 394 | return AjaxResult.returnSuccess(); |
| 225 | 395 | } |
| 226 | 396 | DiagnoseAssit assist = assistService.getDetailByDiagnoseInfo(info.getId(), DiagnoseAssit.DIAGNOSE_TYPE_BIRTH);// 诊断类型:1婚前检查,【2产检】,3儿保检查 |
| 227 | - List<HistoryMaps> historyList = historyMapsService.getListByTarget(info.getId(), HistoryMaps.TARGET_TYPE_EXAM);// 关联目标类型:1产检、2妇女建档 | |
| 228 | - List<DiagnoseTai> taiList = diagnoseTaiService.getListByExamId(info.getId()); | |
| 229 | - | |
| 230 | - | |
| 231 | - return AjaxResult.returnFail(); | |
| 397 | + List<HistoryMaps> historyMapsList = historyMapsService.getListByTarget(info.getId(), | |
| 398 | + HistoryMaps.TARGET_TYPE_EXAM);// 关联目标类型:1产检、2妇女建档 | |
| 399 | + List<DiagnoseTai> diagnoseTaiList = diagnoseTaiService.getListByExamId(info.getId()); | |
| 400 | + ExamAddRequestWrapper wrapper = new ExamAddRequestWrapper(info, assist, historyMapsList, diagnoseTaiList); | |
| 401 | + return AjaxResult.returnSuccess(wrapper.getExamAddRequest()); | |
| 232 | 402 | } |
| 233 | 403 | |
| 234 | 404 | /** |
| ... | ... | @@ -246,7 +416,7 @@ |
| 246 | 416 | /* |
| 247 | 417 | * 同一产程不能新增两次初诊:(如果条件是新增,根据孕妇档案ID WOMAN_ID 查询产检记录列表) TODO |
| 248 | 418 | */ |
| 249 | - // | |
| 419 | + | |
| 250 | 420 | /* |
| 251 | 421 | * (1)保存产检基本信息 (2)保存辅助检查信息 (3)批量保存病史信息(4)多个胎儿信息(5) 多个诊断信息 TODO |
| 252 | 422 | */ |
| 253 | 423 | |
| 254 | 424 | |
| 255 | 425 | |
| 256 | 426 | |
| ... | ... | @@ -279,63 +449,53 @@ |
| 279 | 449 | * |
| 280 | 450 | */ |
| 281 | 451 | // 基本验证 |
| 282 | - String orgId = "1";// orgId或来自token | |
| 283 | -// if (StringUtils.isEmpty(orgId)) { | |
| 284 | -// return AjaxResult.returnFail("入参错误:医院ID为空"); | |
| 285 | -// } | |
| 452 | + Users users = ShiroWebUtils.getCurrentUser(); | |
| 453 | + String orgId = users.getOrgId(); | |
| 454 | + if (StringUtils.isEmpty(orgId)) { | |
| 455 | + return AjaxResult.returnFail("入参错误:医院ID为空"); | |
| 456 | + } | |
| 286 | 457 | if (StringUtils.isEmpty(cardNo) && StringUtils.isEmpty(vcCardNo)) { |
| 287 | 458 | return AjaxResult.returnFail("入参错误:查询条件为空"); |
| 288 | 459 | } |
| 289 | - // (1)孕妇档案信息(通过证件号或就诊卡号查询) | |
| 290 | - WomanFetationRecord query = new WomanFetationRecord(); | |
| 291 | - query.setHostpitalId(orgId);// 医院ID | |
| 292 | - WomanFetationRecord dbFetationRecord = null; | |
| 293 | - | |
| 294 | - // 证件号不为空,则通过证件号查询 | |
| 295 | - if (!StringUtils.isEmpty(cardNo)) { | |
| 296 | - query.setBasePapersNumber(cardNo); | |
| 297 | - dbFetationRecord = fetationService.queryEffectiveOne(query); | |
| 298 | - } | |
| 299 | - // 上述查询未执行或没结果,且就诊卡号不为空,则通过就诊卡号查询 | |
| 300 | - if (dbFetationRecord == null && !StringUtils.isEmpty(vcCardNo)) { | |
| 301 | - query.setBasePapersNumber(null); | |
| 302 | - query.setContactWomanWay(vcCardNo); | |
| 303 | - dbFetationRecord = fetationService.queryEffectiveOne(query); | |
| 304 | - } | |
| 460 | + // 组装返回对象-查询孕妇建档信息 | |
| 461 | + Map<String, Object> dataMap = fetationService.selectTopFetationInfo(cardNo, vcCardNo, orgId); | |
| 305 | 462 | // 未查询到孕妇建档信息 |
| 306 | - if (dbFetationRecord == null) { | |
| 307 | - return AjaxResult.returnSuccess(null);//将基本的对象返回空 | |
| 463 | + if (dataMap == null) { | |
| 464 | + return AjaxResult.returnSuccess(null);// 将基本的对象返回空 | |
| 308 | 465 | } |
| 309 | - // (2)高危因素列表 TODO | |
| 310 | - List<Map<String, Object>> riskFactor = new ArrayList<>(); | |
| 311 | - // (3)产检记录列表 TODO (此处需要查询当前产程中本院和外院的所有产检记录(包括分布建档的),之后对接方承) | |
| 312 | - List<Map<String, Object>> data = new ArrayList<>(); // data 系前端指定名称 | |
| 313 | - // (4)组装返回对象 | |
| 314 | - Map<String, Object> dataMap = new HashMap<>(); | |
| 315 | - dataMap.put("id", dbFetationRecord.getId()); | |
| 316 | - dataMap.put("pid", dbFetationRecord.getWomanPersonId()); | |
| 317 | - dataMap.put("name", dbFetationRecord.getBaseWomanName()); | |
| 318 | - dataMap.put("age", DateUtil.getAge(dbFetationRecord.getBaseWomanBirth())); | |
| 319 | - // 根据“纠正末次月经”计算孕周 | |
| 320 | - dataMap.put("dueWeek", HospitalUtil.getPregnantWeek(dbFetationRecord.getHospitalCorrectLastMenstruation())); | |
| 321 | - dataMap.put("yChanQi", dbFetationRecord.getHospitalExpectedDateStr()); | |
| 322 | - dataMap.put("phone", dbFetationRecord.getContactWomanWay()); | |
| 323 | - dataMap.put("riskScore", "15");// TODO 高危评分 | |
| 324 | - dataMap.put("remarks", dbFetationRecord.getHospitalRecordRemark()); | |
| 325 | - dataMap.put("lastMenses", dbFetationRecord.getHospitalLastMenstruationStr()); | |
| 326 | - dataMap.put("buildTime", dbFetationRecord.getHospitalRecordDateStr());// 建档日期 | |
| 327 | - dataMap.put("lastBuildTime", dbFetationRecord.getHospitalRecordDateStr());// TODO | |
| 328 | - // ? | |
| 329 | - dataMap.put("birth", dbFetationRecord.getBaseWomanBirthStr()); | |
| 330 | - dataMap.put("tireNumber1", "1");// TODO ? | |
| 331 | - dataMap.put("cardNo", dbFetationRecord.getBasePapersNumber()); | |
| 332 | - dataMap.put("vcCardNo", dbFetationRecord.getHospitalPatientCard()); | |
| 333 | - dataMap.put("isSieve", "0");// TODO? | |
| 334 | - dataMap.put("isH", "0");// TODO? | |
| 466 | + WomanFetationRecord dbFetationRecord = (WomanFetationRecord)dataMap.get("dbFetationRecord"); | |
| 335 | 467 | |
| 336 | - dataMap.put("riskFactor", riskFactor); | |
| 337 | - dataMap.put("data", data); | |
| 338 | - dataMap.put("now", DateUtil.getyyyy_MM_dd_hms(new Date())); | |
| 468 | + // 产检记录列表 TODO (此处需要查询当前产程中本院和外院的所有产检记录(包括分布建档的),之后对接方承) | |
| 469 | + List<Map<String, Object>> data = new ArrayList<>(); // data 系前端指定名称 | |
| 470 | + List<DiagnoseInfo> diagnoseInfoList = infoService.getInfoListByWomanId(dbFetationRecord.getId()); | |
| 471 | + if (!CollectionUtils.isEmpty(diagnoseInfoList)) { | |
| 472 | + for (DiagnoseInfo d : diagnoseInfoList) { | |
| 473 | + Map<String, Object> diagnoseInfoMap = new HashMap<>(); | |
| 474 | + // 末次月经到产检时间的孕周数 | |
| 475 | + diagnoseInfoMap.put("dueWeek", HospitalUtil | |
| 476 | + .getPregnantWeek(dbFetationRecord.getHospitalCorrectLastMenstruation(), d.getDiagnoseTime())); | |
| 477 | + diagnoseInfoMap.put("dueDate", DateUtil.getyyyy_MM_dd(dbFetationRecord.getHospitalExpectedDate()));// 预产期 | |
| 478 | + diagnoseInfoMap.put("id", d.getId()); | |
| 479 | + diagnoseInfoMap.put("checkTime", DateUtil.getyyyy_MM_dd(d.getDiagnoseTime())); | |
| 480 | + if (d.getType() != null) { | |
| 481 | + if (d.getType() == DiagnoseInfo.TYPE_FIRST) { | |
| 482 | + diagnoseInfoMap.put("title", "初诊");// 诊断类型,2为初诊,3为复诊 | |
| 483 | + } else if (d.getType() == DiagnoseInfo.TYPE_SECOND) { | |
| 484 | + diagnoseInfoMap.put("title", "复诊");// 诊断类型,2为初诊,3为复诊 | |
| 485 | + } | |
| 486 | + } else { | |
| 487 | + diagnoseInfoMap.put("title", null); | |
| 488 | + } | |
| 489 | + diagnoseInfoMap.put("type", d.getType());// 诊断类型,2为初诊,3为复诊 | |
| 490 | + diagnoseInfoMap.put("hospitalName", orgService.getNameById(d.getOrgId())); | |
| 491 | + diagnoseInfoMap.put("hospitalId", d.getOrgId()); | |
| 492 | + diagnoseInfoMap.put("enableEdit", "1");// 是否允许编辑 | |
| 493 | + data.add(diagnoseInfoMap); | |
| 494 | + } | |
| 495 | + } | |
| 496 | + | |
| 497 | + dataMap.put("data", data);//产检记录列表 | |
| 498 | + dataMap.remove("dbFetationRecord"); | |
| 339 | 499 | return AjaxResult.returnSuccess(dataMap); |
| 340 | 500 | } |
| 341 | 501 |
parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequest.java
View file @
91a052c
| 1 | +package com.lyms.hospital.request.exam; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +import com.lyms.hospital.util.Form; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * Created by Administrator on 2016/6/17 0017. | |
| 11 | + */ | |
| 12 | +@Form | |
| 13 | +public class ChildbirthAddRequest{ | |
| 14 | + private String id; | |
| 15 | + // | |
| 16 | + private String pid; | |
| 17 | + //产妇id | |
| 18 | + private String parentId; | |
| 19 | + //分娩时间 | |
| 20 | + private String dueDate; | |
| 21 | + //分娩孕周 | |
| 22 | + private String dueWeek; | |
| 23 | + //胎数 | |
| 24 | + private Integer tireNumber; | |
| 25 | + //胎盘 | |
| 26 | + private String placenta; | |
| 27 | + //胎盘信息 | |
| 28 | + private List<Placenta> placentas; | |
| 29 | + //胎盘及新生儿 | |
| 30 | + private List<Map<String,Object>> extPlacentas; | |
| 31 | + //分娩方式 | |
| 32 | + private Map deliveryMode; | |
| 33 | + //手术原因 | |
| 34 | + private String operationCause; | |
| 35 | + //产程 h 小时 m 分 | |
| 36 | + private Map prodprocess; | |
| 37 | + //总产程 | |
| 38 | + private Map totalprocess; | |
| 39 | + //会阴情况 | |
| 40 | + private String perinealCondition; | |
| 41 | + //撕裂等级 | |
| 42 | + private Integer siLielevel; | |
| 43 | + //锋线针数 | |
| 44 | + private Integer needleNum; | |
| 45 | + //产妇情况 | |
| 46 | + private String maternalInfo; | |
| 47 | + //死亡原因 | |
| 48 | + private String deathCause; | |
| 49 | + //死亡原因其他 | |
| 50 | + private String deathCauseText; | |
| 51 | + //产后血压 | |
| 52 | + private Map chBp; | |
| 53 | + //产后2小时血压 | |
| 54 | + private Map ch2Bp; | |
| 55 | + //呼吸 | |
| 56 | + private String breath; | |
| 57 | + // 脉搏 | |
| 58 | + private String pulse; | |
| 59 | + // 一小时失血量 | |
| 60 | + private Double oHloseBloodL; | |
| 61 | + //二小时失血量 | |
| 62 | + private Double tHloseBloodL; | |
| 63 | + //二十四小时失血量 | |
| 64 | + private Double rHloseBloodL; | |
| 65 | + //第3产层+产后失血量 | |
| 66 | + private Double sHloseBloodL; | |
| 67 | + //失血原因 | |
| 68 | + private java.util.Map loseBloodCause; | |
| 69 | + //产科并发症 | |
| 70 | + private java.util.Map ocs; | |
| 71 | + | |
| 72 | + | |
| 73 | + private List<Baby> babies; | |
| 74 | + //分娩医院 | |
| 75 | + private String fmHospital; | |
| 76 | + //接生医生 | |
| 77 | + private String deliverDoctor; | |
| 78 | + | |
| 79 | + public String getPid() { | |
| 80 | + return pid; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setPid(String pid) { | |
| 84 | + this.pid = pid; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getDeathCauseText() { | |
| 88 | + return deathCauseText; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setDeathCauseText(String deathCauseText) { | |
| 92 | + this.deathCauseText = deathCauseText; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public List<Map<String,Object>> getExtPlacentas() { | |
| 96 | + return extPlacentas; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setExtPlacentas(List<Map<String,Object>> extPlacentas) { | |
| 100 | + this.extPlacentas = extPlacentas; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public Double getoHloseBloodL() { | |
| 104 | + return oHloseBloodL; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setoHloseBloodL(Double oHloseBloodL) { | |
| 108 | + this.oHloseBloodL = oHloseBloodL; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public Double getrHloseBloodL() { | |
| 112 | + return rHloseBloodL; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setrHloseBloodL(Double rHloseBloodL) { | |
| 116 | + this.rHloseBloodL = rHloseBloodL; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public Double getsHloseBloodL() { | |
| 120 | + return sHloseBloodL; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setsHloseBloodL(Double sHloseBloodL) { | |
| 124 | + this.sHloseBloodL = sHloseBloodL; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public Double gettHloseBloodL() { | |
| 128 | + return tHloseBloodL; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void settHloseBloodL(Double tHloseBloodL) { | |
| 132 | + this.tHloseBloodL = tHloseBloodL; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public List<Baby> getBabies() { | |
| 136 | + return babies; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setBabies(List<Baby> babies) { | |
| 140 | + this.babies = babies; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public String getBreath() { | |
| 144 | + return breath; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setBreath(String breath) { | |
| 148 | + this.breath = breath; | |
| 149 | + } | |
| 150 | + | |
| 151 | + | |
| 152 | + public String getDueDate() { | |
| 153 | + return dueDate; | |
| 154 | + } | |
| 155 | + | |
| 156 | + public void setDueDate(String dueDate) { | |
| 157 | + this.dueDate = dueDate; | |
| 158 | + } | |
| 159 | + | |
| 160 | + public Integer getSiLielevel() { | |
| 161 | + return siLielevel; | |
| 162 | + } | |
| 163 | + | |
| 164 | + public void setSiLielevel(Integer siLielevel) { | |
| 165 | + this.siLielevel = siLielevel; | |
| 166 | + } | |
| 167 | + | |
| 168 | + public String getDueWeek() { | |
| 169 | + return dueWeek; | |
| 170 | + } | |
| 171 | + | |
| 172 | + public void setDueWeek(String dueWeek) { | |
| 173 | + this.dueWeek = dueWeek; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public String getFmHospital() { | |
| 177 | + return fmHospital; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public void setFmHospital(String fmHospital) { | |
| 181 | + this.fmHospital = fmHospital; | |
| 182 | + } | |
| 183 | + | |
| 184 | + public String getId() { | |
| 185 | + return id; | |
| 186 | + } | |
| 187 | + | |
| 188 | + public void setId(String id) { | |
| 189 | + this.id = id; | |
| 190 | + } | |
| 191 | + | |
| 192 | + public Map getLoseBloodCause() { | |
| 193 | + return loseBloodCause; | |
| 194 | + } | |
| 195 | + | |
| 196 | + public void setLoseBloodCause(Map loseBloodCause) { | |
| 197 | + this.loseBloodCause = loseBloodCause; | |
| 198 | + } | |
| 199 | + | |
| 200 | + | |
| 201 | + public Integer getTireNumber() { | |
| 202 | + return tireNumber; | |
| 203 | + } | |
| 204 | + | |
| 205 | + public void setTireNumber(Integer tireNumber) { | |
| 206 | + this.tireNumber = tireNumber; | |
| 207 | + } | |
| 208 | + | |
| 209 | + public String getMaternalInfo() { | |
| 210 | + return maternalInfo; | |
| 211 | + } | |
| 212 | + | |
| 213 | + public void setMaternalInfo(String maternalInfo) { | |
| 214 | + this.maternalInfo = maternalInfo; | |
| 215 | + } | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + public Integer getNeedleNum() { | |
| 220 | + return needleNum; | |
| 221 | + } | |
| 222 | + | |
| 223 | + public void setNeedleNum(Integer needleNum) { | |
| 224 | + this.needleNum = needleNum; | |
| 225 | + } | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + public String getOperationCause() { | |
| 230 | + return operationCause; | |
| 231 | + } | |
| 232 | + | |
| 233 | + public void setOperationCause(String operationCause) { | |
| 234 | + this.operationCause = operationCause; | |
| 235 | + } | |
| 236 | + | |
| 237 | + public String getParentId() { | |
| 238 | + return parentId; | |
| 239 | + } | |
| 240 | + | |
| 241 | + public void setParentId(String parentId) { | |
| 242 | + this.parentId = parentId; | |
| 243 | + } | |
| 244 | + | |
| 245 | + public String getPerinealCondition() { | |
| 246 | + return perinealCondition; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public void setPerinealCondition(String perinealCondition) { | |
| 250 | + this.perinealCondition = perinealCondition; | |
| 251 | + } | |
| 252 | + | |
| 253 | + public String getPlacenta() { | |
| 254 | + return placenta; | |
| 255 | + } | |
| 256 | + | |
| 257 | + public void setPlacenta(String placenta) { | |
| 258 | + this.placenta = placenta; | |
| 259 | + } | |
| 260 | + | |
| 261 | + public List<Placenta> getPlacentas() { | |
| 262 | + return placentas; | |
| 263 | + } | |
| 264 | + | |
| 265 | + public void setPlacentas(List<Placenta> placentas) { | |
| 266 | + this.placentas = placentas; | |
| 267 | + } | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + public String getPulse() { | |
| 272 | + return pulse; | |
| 273 | + } | |
| 274 | + | |
| 275 | + public void setPulse(String pulse) { | |
| 276 | + this.pulse = pulse; | |
| 277 | + } | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + public Map getCh2Bp() { | |
| 283 | + return ch2Bp; | |
| 284 | + } | |
| 285 | + | |
| 286 | + public void setCh2Bp(Map ch2Bp) { | |
| 287 | + this.ch2Bp = ch2Bp; | |
| 288 | + } | |
| 289 | + | |
| 290 | + public Map getChBp() { | |
| 291 | + return chBp; | |
| 292 | + } | |
| 293 | + | |
| 294 | + public void setChBp(Map chBp) { | |
| 295 | + this.chBp = chBp; | |
| 296 | + } | |
| 297 | + | |
| 298 | + public String getDeathCause() { | |
| 299 | + return deathCause; | |
| 300 | + } | |
| 301 | + | |
| 302 | + public void setDeathCause(String deathCause) { | |
| 303 | + this.deathCause = deathCause; | |
| 304 | + } | |
| 305 | + | |
| 306 | + public String getDeliverDoctor() { | |
| 307 | + return deliverDoctor; | |
| 308 | + } | |
| 309 | + | |
| 310 | + public void setDeliverDoctor(String deliverDoctor) { | |
| 311 | + this.deliverDoctor = deliverDoctor; | |
| 312 | + } | |
| 313 | + | |
| 314 | + public Map getDeliveryMode() { | |
| 315 | + return deliveryMode; | |
| 316 | + } | |
| 317 | + | |
| 318 | + public void setDeliveryMode(Map deliveryMode) { | |
| 319 | + this.deliveryMode = deliveryMode; | |
| 320 | + } | |
| 321 | + | |
| 322 | + public Map getOcs() { | |
| 323 | + return ocs; | |
| 324 | + } | |
| 325 | + | |
| 326 | + public void setOcs(Map ocs) { | |
| 327 | + this.ocs = ocs; | |
| 328 | + } | |
| 329 | + | |
| 330 | + public Map getProdprocess() { | |
| 331 | + return prodprocess; | |
| 332 | + } | |
| 333 | + | |
| 334 | + public void setProdprocess(Map prodprocess) { | |
| 335 | + this.prodprocess = prodprocess; | |
| 336 | + } | |
| 337 | + | |
| 338 | + public Map getTotalprocess() { | |
| 339 | + return totalprocess; | |
| 340 | + } | |
| 341 | + | |
| 342 | + public void setTotalprocess(Map totalprocess) { | |
| 343 | + this.totalprocess = totalprocess; | |
| 344 | + } | |
| 345 | + | |
| 346 | + public static class Placenta implements Serializable{ | |
| 347 | + private static final long serialVersionUID = 1L; | |
| 348 | + //心率 | |
| 349 | + private Double heartRate; | |
| 350 | + //胎方位 | |
| 351 | + private String fetalPosition; | |
| 352 | + //胎先露 | |
| 353 | + private String fetalPresentation; | |
| 354 | + // 衔接 | |
| 355 | + private String join; | |
| 356 | + | |
| 357 | + public String getFetalPosition() { | |
| 358 | + return fetalPosition; | |
| 359 | + } | |
| 360 | + | |
| 361 | + public void setFetalPosition(String fetalPosition) { | |
| 362 | + this.fetalPosition = fetalPosition; | |
| 363 | + } | |
| 364 | + | |
| 365 | + public String getFetalPresentation() { | |
| 366 | + return fetalPresentation; | |
| 367 | + } | |
| 368 | + | |
| 369 | + public void setFetalPresentation(String fetalPresentation) { | |
| 370 | + this.fetalPresentation = fetalPresentation; | |
| 371 | + } | |
| 372 | + | |
| 373 | + public Double getHeartRate() { | |
| 374 | + return heartRate; | |
| 375 | + } | |
| 376 | + | |
| 377 | + public void setHeartRate(Double heartRate) { | |
| 378 | + this.heartRate = heartRate; | |
| 379 | + } | |
| 380 | + | |
| 381 | + public String getJoin() { | |
| 382 | + return join; | |
| 383 | + } | |
| 384 | + | |
| 385 | + public void setJoin(String join) { | |
| 386 | + this.join = join; | |
| 387 | + } | |
| 388 | + } | |
| 389 | + | |
| 390 | + public static class Baby{ | |
| 391 | + | |
| 392 | + private String id; | |
| 393 | + //新生儿性别; | |
| 394 | + private String babyGender; | |
| 395 | + //新生儿重量 | |
| 396 | + private String babyWeight; | |
| 397 | + //新生儿生长 | |
| 398 | + private String babyHeight; | |
| 399 | + //畸形 0非畸形 1畸形 | |
| 400 | + private Integer deformity; | |
| 401 | + //apgar评分 | |
| 402 | + private Map apgarScore; | |
| 403 | + //窒息分钟 | |
| 404 | + private String asphyxiaM; | |
| 405 | + // 妊娠结局 | |
| 406 | + private String pregnancyOut; | |
| 407 | + //新生儿疾病 | |
| 408 | + private String babyHealthy; | |
| 409 | + //母婴接触开始 | |
| 410 | + private String contactStartM; | |
| 411 | + //母婴接触时间 | |
| 412 | + private String contactM; | |
| 413 | + //早吮吸 | |
| 414 | + private String earlySuck; | |
| 415 | + //分娩时间 | |
| 416 | + private String dueTime; | |
| 417 | + | |
| 418 | + //儿童诊断 | |
| 419 | + private String babyDiagnosis; | |
| 420 | + | |
| 421 | + //病历号(住院号) | |
| 422 | + private String blNo; | |
| 423 | + | |
| 424 | + public String getBabyDiagnosis() { | |
| 425 | + return babyDiagnosis; | |
| 426 | + } | |
| 427 | + | |
| 428 | + public void setBabyDiagnosis(String babyDiagnosis) { | |
| 429 | + this.babyDiagnosis = babyDiagnosis; | |
| 430 | + } | |
| 431 | + | |
| 432 | + public String getBlNo() { | |
| 433 | + return blNo; | |
| 434 | + } | |
| 435 | + | |
| 436 | + public void setBlNo(String blNo) { | |
| 437 | + this.blNo = blNo; | |
| 438 | + } | |
| 439 | + | |
| 440 | + public String getDueTime() { | |
| 441 | + return dueTime; | |
| 442 | + } | |
| 443 | + | |
| 444 | + public void setDueTime(String dueTime) { | |
| 445 | + this.dueTime = dueTime; | |
| 446 | + } | |
| 447 | + | |
| 448 | + public Map getApgarScore() { | |
| 449 | + return apgarScore; | |
| 450 | + } | |
| 451 | + | |
| 452 | + public void setApgarScore(Map apgarScore) { | |
| 453 | + this.apgarScore = apgarScore; | |
| 454 | + } | |
| 455 | + | |
| 456 | + public String getAsphyxiaM() { | |
| 457 | + return asphyxiaM; | |
| 458 | + } | |
| 459 | + | |
| 460 | + public void setAsphyxiaM(String asphyxiaM) { | |
| 461 | + this.asphyxiaM = asphyxiaM; | |
| 462 | + } | |
| 463 | + | |
| 464 | + public String getBabyGender() { | |
| 465 | + return babyGender; | |
| 466 | + } | |
| 467 | + | |
| 468 | + public void setBabyGender(String babyGender) { | |
| 469 | + this.babyGender = babyGender; | |
| 470 | + } | |
| 471 | + | |
| 472 | + public String getBabyHealthy() { | |
| 473 | + return babyHealthy; | |
| 474 | + } | |
| 475 | + | |
| 476 | + public void setBabyHealthy(String babyHealthy) { | |
| 477 | + this.babyHealthy = babyHealthy; | |
| 478 | + } | |
| 479 | + | |
| 480 | + public String getBabyHeight() { | |
| 481 | + return babyHeight; | |
| 482 | + } | |
| 483 | + | |
| 484 | + public void setBabyHeight(String babyHeight) { | |
| 485 | + this.babyHeight = babyHeight; | |
| 486 | + } | |
| 487 | + | |
| 488 | + public String getBabyWeight() { | |
| 489 | + return babyWeight; | |
| 490 | + } | |
| 491 | + | |
| 492 | + public void setBabyWeight(String babyWeight) { | |
| 493 | + this.babyWeight = babyWeight; | |
| 494 | + } | |
| 495 | + | |
| 496 | + public String getContactM() { | |
| 497 | + return contactM; | |
| 498 | + } | |
| 499 | + | |
| 500 | + public void setContactM(String contactM) { | |
| 501 | + this.contactM = contactM; | |
| 502 | + } | |
| 503 | + | |
| 504 | + public String getContactStartM() { | |
| 505 | + return contactStartM; | |
| 506 | + } | |
| 507 | + | |
| 508 | + public void setContactStartM(String contactStartM) { | |
| 509 | + this.contactStartM = contactStartM; | |
| 510 | + } | |
| 511 | + | |
| 512 | + public Integer getDeformity() { | |
| 513 | + return deformity; | |
| 514 | + } | |
| 515 | + | |
| 516 | + public void setDeformity(Integer deformity) { | |
| 517 | + this.deformity = deformity; | |
| 518 | + } | |
| 519 | + | |
| 520 | + public String getEarlySuck() { | |
| 521 | + return earlySuck; | |
| 522 | + } | |
| 523 | + | |
| 524 | + public void setEarlySuck(String earlySuck) { | |
| 525 | + this.earlySuck = earlySuck; | |
| 526 | + } | |
| 527 | + | |
| 528 | + public String getId() { | |
| 529 | + return id; | |
| 530 | + } | |
| 531 | + | |
| 532 | + public void setId(String id) { | |
| 533 | + this.id = id; | |
| 534 | + } | |
| 535 | + | |
| 536 | + public String getPregnancyOut() { | |
| 537 | + return pregnancyOut; | |
| 538 | + } | |
| 539 | + | |
| 540 | + public void setPregnancyOut(String pregnancyOut) { | |
| 541 | + this.pregnancyOut = pregnancyOut; | |
| 542 | + } | |
| 543 | + | |
| 544 | + @Override | |
| 545 | + public String toString() { | |
| 546 | + return "Baby{" + | |
| 547 | + "id='" + id + '\'' + | |
| 548 | + ", babyGender='" + babyGender + '\'' + | |
| 549 | + ", babyWeight='" + babyWeight + '\'' + | |
| 550 | + ", babyHeight='" + babyHeight + '\'' + | |
| 551 | + ", deformity=" + deformity + | |
| 552 | + ", apgarScore=" + apgarScore + | |
| 553 | + ", asphyxiaM='" + asphyxiaM + '\'' + | |
| 554 | + ", pregnancyOut='" + pregnancyOut + '\'' + | |
| 555 | + ", babyHealthy='" + babyHealthy + '\'' + | |
| 556 | + ", contactStartM='" + contactStartM + '\'' + | |
| 557 | + ", contactM='" + contactM + '\'' + | |
| 558 | + ", earlySuck='" + earlySuck + '\'' + | |
| 559 | + ", dueTime='" + dueTime + '\'' + | |
| 560 | + '}'; | |
| 561 | + } | |
| 562 | + } | |
| 563 | +/* public static void main(String[] args){ | |
| 564 | + MatDeliverAddRequest matDeliverAddRequest = new MatDeliverAddRequest(); | |
| 565 | + List<Baby> babies = new ArrayList<>(); | |
| 566 | + babies.add(matDeliverAddRequest .new Baby()); | |
| 567 | + matDeliverAddRequest.setBabies(babies); | |
| 568 | + System.out.print(JsonUtil.obj2JsonString(matDeliverAddRequest)); | |
| 569 | + }*/ | |
| 570 | + | |
| 571 | + @Override | |
| 572 | + public String toString() { | |
| 573 | + return "MatDeliverAddRequest{" + | |
| 574 | + "id='" + id + '\'' + | |
| 575 | + ", pid='" + pid + '\'' + | |
| 576 | + ", parentId='" + parentId + '\'' + | |
| 577 | + ", dueDate='" + dueDate + '\'' + | |
| 578 | + ", dueWeek='" + dueWeek + '\'' + | |
| 579 | + ", tireNumber=" + tireNumber + | |
| 580 | + ", placenta='" + placenta + '\'' + | |
| 581 | + ", placentas=" + placentas + | |
| 582 | + ", extPlacentas=" + extPlacentas + | |
| 583 | + ", deliveryMode=" + deliveryMode + | |
| 584 | + ", operationCause='" + operationCause + '\'' + | |
| 585 | + ", prodprocess=" + prodprocess + | |
| 586 | + ", totalprocess=" + totalprocess + | |
| 587 | + ", perinealCondition='" + perinealCondition + '\'' + | |
| 588 | + ", siLielevel=" + siLielevel + | |
| 589 | + ", needleNum=" + needleNum + | |
| 590 | + ", maternalInfo='" + maternalInfo + '\'' + | |
| 591 | + ", deathCause='" + deathCause + '\'' + | |
| 592 | + ", deathCauseText='" + deathCauseText + '\'' + | |
| 593 | + ", chBp=" + chBp + | |
| 594 | + ", ch2Bp=" + ch2Bp + | |
| 595 | + ", breath='" + breath + '\'' + | |
| 596 | + ", pulse='" + pulse + '\'' + | |
| 597 | + ", oHloseBloodL=" + oHloseBloodL + | |
| 598 | + ", tHloseBloodL=" + tHloseBloodL + | |
| 599 | + ", rHloseBloodL=" + rHloseBloodL + | |
| 600 | + ", sHloseBloodL=" + sHloseBloodL + | |
| 601 | + ", loseBloodCause=" + loseBloodCause + | |
| 602 | + ", ocs=" + ocs + | |
| 603 | + ", babies=" + babies.toString() + | |
| 604 | + ", fmHospital='" + fmHospital + '\'' + | |
| 605 | + ", deliverDoctor='" + deliverDoctor + '\'' + | |
| 606 | + '}'; | |
| 607 | + } | |
| 608 | +} |
parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ChildbirthAddRequestWrapper.java
View file @
91a052c
| 1 | +package com.lyms.hospital.request.exam; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +import com.lyms.hospital.entity.childbirth.ChildbirthInfo; | |
| 6 | +import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo; | |
| 7 | +import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; | |
| 8 | +import com.lyms.hospital.entity.childbirth.ChildbirthTai; | |
| 9 | +import com.lyms.hospital.entity.childbirth.ChildbirthTaipan; | |
| 10 | + | |
| 11 | +public class ChildbirthAddRequestWrapper { | |
| 12 | + | |
| 13 | + private ChildbirthAddRequest request; | |
| 14 | + private ChildbirthInfoVo vo; | |
| 15 | + private ChildbirthInfo info; | |
| 16 | + private List<ChildbirthNewborn> newbornList; | |
| 17 | + private List<ChildbirthTaipan> taipanList; | |
| 18 | + private List<ChildbirthTai> taiList; | |
| 19 | + | |
| 20 | + public ChildbirthAddRequestWrapper() { | |
| 21 | + } | |
| 22 | + | |
| 23 | + public ChildbirthAddRequestWrapper(ChildbirthAddRequest req) { | |
| 24 | + this.request = req; | |
| 25 | + if(req!=null){ | |
| 26 | + String[] req_map = {"id","pid","parentId"}; | |
| 27 | + String[] info_map = {"id","personId","womanId"}; | |
| 28 | + info = new ChildbirthInfo(); | |
| 29 | +// info.setId(req.getId()); | |
| 30 | +// info.setPersonId(req.getPid()); | |
| 31 | + } | |
| 32 | + | |
| 33 | + } | |
| 34 | + | |
| 35 | + public ChildbirthAddRequest getRequest() { | |
| 36 | + return request; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setRequest(ChildbirthAddRequest request) { | |
| 40 | + this.request = request; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public ChildbirthInfoVo getVo() { | |
| 44 | + return vo; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setVo(ChildbirthInfoVo vo) { | |
| 48 | + this.vo = vo; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public ChildbirthInfo getInfo() { | |
| 52 | + return info; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setInfo(ChildbirthInfo info) { | |
| 56 | + this.info = info; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public List<ChildbirthNewborn> getNewbornList() { | |
| 60 | + return newbornList; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setNewbornList(List<ChildbirthNewborn> newbornList) { | |
| 64 | + this.newbornList = newbornList; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public List<ChildbirthTaipan> getTaipanList() { | |
| 68 | + return taipanList; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setTaipanList(List<ChildbirthTaipan> taipanList) { | |
| 72 | + this.taipanList = taipanList; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public List<ChildbirthTai> getTaiList() { | |
| 76 | + return taiList; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setTaiList(List<ChildbirthTai> taiList) { | |
| 80 | + this.taiList = taiList; | |
| 81 | + } | |
| 82 | + | |
| 83 | +} |
parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ExamAddRequestWrapper.java
View file @
91a052c
| 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 | |
| 7 | 8 | |
| ... | ... | @@ -34,9 +35,12 @@ |
| 34 | 35 | * 胎儿列表信息 |
| 35 | 36 | */ |
| 36 | 37 | private List<DiagnoseTai> diagnoseTaiList = new ArrayList<>(); |
| 38 | + | |
| 39 | + public ExamAddRequestWrapper(){} | |
| 37 | 40 | |
| 38 | 41 | public ExamAddRequestWrapper(DiagnoseInfo info,DiagnoseAssit assist, |
| 39 | 42 | List<HistoryMaps> historyMapsList,List<DiagnoseTai> diagnoseTaiList) { |
| 43 | + //List<HistorySource> historySourceList | |
| 40 | 44 | this.diagnoseInfo = info; |
| 41 | 45 | this.diagnoseAssit = assist; |
| 42 | 46 | this.historyMapsList = historyMapsList; |
| 43 | 47 | |
| 44 | 48 | |
| ... | ... | @@ -47,13 +51,66 @@ |
| 47 | 51 | Map<String, Object> assistMap = XjhMapUtil.transBean2FormatAliasMap(assist, |
| 48 | 52 | XjhMapUtil.getKeyMap(WomanExamKeymap.original, WomanExamKeymap.alias)); |
| 49 | 53 | infoMap.putAll(assistMap); |
| 50 | - this.examAddRequest = (ExamAddRequest) XjhMapUtil.transMap2AliasBean(infoMap, new ExamAddRequest(), | |
| 54 | + examAddRequest = (ExamAddRequest) XjhMapUtil.transMap2AliasBean(infoMap, new ExamAddRequest(), | |
| 51 | 55 | XjhMapUtil.getKeyMap(WomanExamKeymap.original, WomanExamKeymap.alias)); |
| 56 | + examAddRequest.setParentId(info.getWomanId());// 孕妇档案ID | |
| 57 | + examAddRequest.setPid(info.getPersonId());// 女性居民 | |
| 58 | + // 血压 | |
| 59 | + Map<String, Object> bp = new HashMap<>(); | |
| 60 | + bp.put("ssy", info.getBloodShrink()); | |
| 61 | + bp.put("szy", info.getBloodDiastole()); | |
| 62 | + examAddRequest.setBp(bp); | |
| 63 | + // 处理辅助检查,"yin","ruoyang","yang"字段 | |
| 64 | + Map<Integer,String> keyMap = new HashMap<>(); | |
| 65 | + keyMap.put(DiagnoseAssit.YIN,"yin"); | |
| 66 | + keyMap.put(DiagnoseAssit.YANG,"yang"); | |
| 67 | + keyMap.put(DiagnoseAssit.RUOYANG,"ruoyang"); | |
| 68 | + keyMap.put(null,null); | |
| 69 | + examAddRequest.setBg(keyMap.get(assist.getLiverBg()));//丙肝 | |
| 70 | + examAddRequest.setRh(keyMap.get(assist.getBloodtypeRh()));//RH血型 | |
| 71 | + examAddRequest.setYgbmky(keyMap.get(assist.getHepatitisbYgbmky()));//乙肝表面抗原 | |
| 72 | + examAddRequest.setYgbmkt(keyMap.get(assist.getHepatitisbYgbmkt()));//乙肝表面抗体 | |
| 73 | + examAddRequest.setYgeky(keyMap.get(assist.getHepatitisbYgeky()));//乙肝e抗原 | |
| 74 | + examAddRequest.setYgekt(keyMap.get(assist.getHepatitisbYgekt()));//乙肝e抗体 | |
| 75 | + examAddRequest.setYghxkt(keyMap.get(assist.getHepatitisbYghxkt()));//乙肝核心抗体 | |
| 76 | + examAddRequest.setHivkt(keyMap.get(assist.getSyphilisHiv()));//HIV抗体检测 | |
| 77 | + examAddRequest.setSyjg(keyMap.get(assist.getSyphilisSyjg()));//梅毒血清实验结果 | |
| 78 | + // 阴道分泌物 | |
| 79 | + Map<String, Object> ydfmw = new HashMap<>(); | |
| 80 | + ydfmw.put("ydqjd", assist.getVaginaYdqjd()); | |
| 81 | + ydfmw.put("qtText", assist.getVaginaOtherTxt()); | |
| 82 | + ydfmw.put("qt", new Integer(1).equals(assist.getVaginaOther())); | |
| 83 | + ydfmw.put("jsjmj", new Integer(1).equals(assist.getVaginaJsjmj())); | |
| 84 | + ydfmw.put("dc", new Integer(1).equals(assist.getVaginaDc())); | |
| 85 | + examAddRequest.setYdfmw(ydfmw); | |
| 86 | + // 病史信息 | |
| 87 | + examAddRequest.setHistoryList(historyMapsList); | |
| 88 | + // hHealthInfo 丈夫健康情况(特殊处理) | |
| 89 | + Map<String, String> hHealthInfo = new HashMap<>(); | |
| 90 | + if(historyMapsList!=null && !historyMapsList.isEmpty()){ | |
| 91 | + for(HistoryMaps hm : historyMapsList){ | |
| 92 | + if(HistoryMaps.ZFJKQK.equals(hm.getId())){//丈夫健康情况 | |
| 93 | + hHealthInfo.put("qt", hm.getOtherTxt()); | |
| 94 | + hHealthInfo.put("yesOrNo", "yes"); | |
| 95 | + break; | |
| 96 | + } | |
| 97 | + } | |
| 98 | + } | |
| 99 | + examAddRequest.sethHealthInfo(hHealthInfo); | |
| 100 | + // 胎儿信息 | |
| 101 | + List<Map<String,Object>> placentas = new ArrayList<>(); | |
| 102 | + if(diagnoseTaiList!=null && !diagnoseTaiList.isEmpty()){ | |
| 103 | + for(DiagnoseTai tai : diagnoseTaiList){ | |
| 104 | + Map<String,Object> taiMap = new HashMap<>(); | |
| 105 | + taiMap.put("heartRate", tai.getHeartRate()); | |
| 106 | + taiMap.put("fetalPosition", tai.getPosition()); | |
| 107 | + taiMap.put("fetalPresentation", tai.getFirstExpose()); | |
| 108 | + taiMap.put("join", tai.getIsLink()); | |
| 109 | + placentas.add(taiMap); | |
| 110 | + } | |
| 111 | + } | |
| 112 | + examAddRequest.setPlacentas(placentas); | |
| 52 | 113 | } |
| 53 | - | |
| 54 | - public ExamAddRequestWrapper(){ | |
| 55 | - | |
| 56 | - } | |
| 57 | 114 | |
| 58 | 115 | @SuppressWarnings("unchecked") |
| 59 | 116 | public ExamAddRequestWrapper(ExamAddRequest request) { |
| ... | ... | @@ -95,7 +152,6 @@ |
| 95 | 152 | } |
| 96 | 153 | } |
| 97 | 154 | diagnoseAssit = (DiagnoseAssit) XjhMapUtil.transMap2FormatBean(assistMap, new DiagnoseAssit()); |
| 98 | - // 其他老版本结构数据补录 | |
| 99 | 155 | // 阴道分泌物 |
| 100 | 156 | Map<String, Object> ydfmw = request.getYdfmw(); |
| 101 | 157 | if (ydfmw != null) { |
| ... | ... | @@ -155,8 +211,8 @@ |
| 155 | 211 | } |
| 156 | 212 | } |
| 157 | 213 | } |
| 158 | - } // 病史信息 end | |
| 159 | - // hHealthInfo 丈夫健康情况(特殊处理) | |
| 214 | + } | |
| 215 | + | |
| 160 | 216 | Map<String, String> hHealthInfo = request.gethHealthInfo(); |
| 161 | 217 | if (hHealthInfo != null) { |
| 162 | 218 | if ("yes".equals(this.obj2Str(hHealthInfo.get("yesOrNo")))) { |
parent/hospital.web/src/main/java/com/lyms/hospital/util/HospitalUtil.java
View file @
91a052c
| 1 | -package com.lyms.hospital.util; | |
| 2 | - | |
| 3 | -import java.util.Date; | |
| 4 | - | |
| 5 | -import com.lyms.util.DateUtil; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * 计算孕周<br> | |
| 9 | - * a<br> | |
| 10 | - * | |
| 11 | - * @author xujiahong | |
| 12 | - * | |
| 13 | - */ | |
| 14 | -public class HospitalUtil { | |
| 15 | - | |
| 16 | - /** | |
| 17 | - * <li>@Description: | |
| 18 | - * <li>@param date 末次月经日期 | |
| 19 | - * <li>@return | |
| 20 | - * <li>创建人:xujiahong | |
| 21 | - * <li>创建时间:2017年4月24日 | |
| 22 | - * <li>修改人: | |
| 23 | - * <li>修改时间: | |
| 24 | - */ | |
| 25 | - public static String getPregnantWeek(Date date) { | |
| 26 | - Date now = new Date(); | |
| 27 | - int days = DateUtil.daysBetween(date, now);//返回两个日期的间隔天数 | |
| 28 | - if (days < 0) { | |
| 29 | - return ""; | |
| 30 | - } | |
| 31 | - if (days >= 294) { | |
| 32 | - return "已分娩"; | |
| 33 | - } | |
| 34 | - int week = (days / 7); | |
| 35 | - int day = (days % 7); | |
| 36 | - return "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 37 | - } | |
| 38 | - | |
| 39 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/util/UnitConstants.java
View file @
91a052c
| 1 | -package com.lyms.hospital.util; | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * | |
| 5 | - * 单位常量,用以返回值拼接 | |
| 6 | - * | |
| 7 | - * Created by Administrator on 2017/1/11 0011. | |
| 8 | - */ | |
| 9 | -public class UnitConstants { | |
| 10 | - | |
| 11 | - public static final String CM = " cm"; | |
| 12 | - public static final String KG = " kg"; | |
| 13 | - public static final String MMHG = " mmHg"; | |
| 14 | - public static final String CIFEN = " 次/分"; | |
| 15 | - public static final String GL = " g/L"; | |
| 16 | - public static final String MMOLL = " mmol/L"; | |
| 17 | - public static final String CI = " 次"; | |
| 18 | - public static final String UL = " U/L"; | |
| 19 | - public static final String TEN_LKG = "×10<sup>9</sup>/L"; | |
| 20 | -// public static final String TEN_LKG = " 10^9/L"; | |
| 21 | - public static final String UMOLL = " umol/L"; | |
| 22 | - public static final String ZHEN = " 针"; | |
| 23 | - public static final String ML = " ml"; | |
| 24 | - public static final String G = " g"; | |
| 25 | - public static final String FEN = " 分"; | |
| 26 | - public static final String FZ = " 分钟"; | |
| 27 | - public static final String GE = " 个"; | |
| 28 | - public static final String SUI = " 岁"; | |
| 29 | - public static final String REN = " 人"; | |
| 30 | - public static final String HD = " 时/日"; | |
| 31 | - public static final String WENDU = " ℃"; | |
| 32 | - public static final String WSSD = " IU/日"; | |
| 33 | - public static final String DAY = " 天"; | |
| 34 | - | |
| 35 | - | |
| 36 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/OldDictionary.java
View file @
91a052c
| 1 | -package com.lyms.hospital.util.trans; | |
| 2 | - | |
| 3 | -public class OldDictionary { | |
| 4 | - | |
| 5 | - private String id; | |
| 6 | - private String hildConfigs; | |
| 7 | - private String code; | |
| 8 | - private String desc; | |
| 9 | - private Integer enable; | |
| 10 | - private String name; | |
| 11 | - private String parentId; | |
| 12 | - | |
| 13 | - public OldDictionary(){} | |
| 14 | - | |
| 15 | - public OldDictionary(String id,String name){ | |
| 16 | - this.id = id; | |
| 17 | - this.name = name; | |
| 18 | - this.enable = 1; | |
| 19 | - } | |
| 20 | - | |
| 21 | - public String getId() { | |
| 22 | - return id; | |
| 23 | - } | |
| 24 | - public void setId(String id) { | |
| 25 | - this.id = id; | |
| 26 | - } | |
| 27 | - public String getHildConfigs() { | |
| 28 | - return hildConfigs; | |
| 29 | - } | |
| 30 | - public void setHildConfigs(String hildConfigs) { | |
| 31 | - this.hildConfigs = hildConfigs; | |
| 32 | - } | |
| 33 | - public String getCode() { | |
| 34 | - return code; | |
| 35 | - } | |
| 36 | - public void setCode(String code) { | |
| 37 | - this.code = code; | |
| 38 | - } | |
| 39 | - public String getDesc() { | |
| 40 | - return desc; | |
| 41 | - } | |
| 42 | - public void setDesc(String desc) { | |
| 43 | - this.desc = desc; | |
| 44 | - } | |
| 45 | - public Integer getEnable() { | |
| 46 | - return enable; | |
| 47 | - } | |
| 48 | - public void setEnable(Integer enable) { | |
| 49 | - this.enable = enable; | |
| 50 | - } | |
| 51 | - public String getName() { | |
| 52 | - return name; | |
| 53 | - } | |
| 54 | - public void setName(String name) { | |
| 55 | - this.name = name; | |
| 56 | - } | |
| 57 | - public String getParentId() { | |
| 58 | - return parentId; | |
| 59 | - } | |
| 60 | - public void setParentId(String parentId) { | |
| 61 | - this.parentId = parentId; | |
| 62 | - } | |
| 63 | - | |
| 64 | - | |
| 65 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java
View file @
91a052c
| 1 | -package com.lyms.hospital.util.trans; | |
| 2 | - | |
| 3 | -import java.beans.BeanInfo; | |
| 4 | -import java.beans.Introspector; | |
| 5 | -import java.beans.PropertyDescriptor; | |
| 6 | -import java.lang.reflect.InvocationTargetException; | |
| 7 | -import java.lang.reflect.Method; | |
| 8 | -import java.util.Date; | |
| 9 | -import java.util.HashMap; | |
| 10 | -import java.util.HashSet; | |
| 11 | -import java.util.Map; | |
| 12 | -import java.util.Set; | |
| 13 | - | |
| 14 | -import com.lyms.hospital.entity.assist.DiagnoseAssit; | |
| 15 | -import com.lyms.hospital.request.exam.ExamAddRequest; | |
| 16 | -import com.lyms.util.DateUtil; | |
| 17 | - | |
| 18 | -public class XjhMapUtil { | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * 简单处理映射字段类型不匹配的情况 | |
| 22 | - * @param property 目标字段Bean相关信息 | |
| 23 | - * @param value 目标字段值 | |
| 24 | - * @param obj 对象 | |
| 25 | - * @author xujiahong | |
| 26 | - * @throws InvocationTargetException | |
| 27 | - * @throws IllegalArgumentException | |
| 28 | - * @throws IllegalAccessException | |
| 29 | - */ | |
| 30 | - private static void invokeIgnoreType(PropertyDescriptor property,Object value,Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ | |
| 31 | - if(obj==null || property==null){ | |
| 32 | - return; | |
| 33 | - } | |
| 34 | - // 得到property对应的setter方法 | |
| 35 | - Method setter = property.getWriteMethod(); | |
| 36 | - if(value==null){//null值可匹配任何类型的对象 | |
| 37 | - setter.invoke(obj, value); | |
| 38 | - return; | |
| 39 | - } | |
| 40 | - Class<?> keyType = property.getPropertyType(); | |
| 41 | - Class<?> valueType = value.getClass(); | |
| 42 | - //简单处理映射字段类型不匹配的情况 | |
| 43 | - if (keyType.equals(valueType)) { | |
| 44 | - setter.invoke(obj, value); | |
| 45 | - } else { | |
| 46 | - if(keyType.equals(String.class)){ | |
| 47 | - setter.invoke(obj, value.toString()); | |
| 48 | - }else if(keyType.equals(Integer.class)){ | |
| 49 | - setter.invoke(obj, Integer.parseInt(value.toString())); | |
| 50 | - }else if(keyType.equals(Double.class)){ | |
| 51 | - setter.invoke(obj, Double.parseDouble(value.toString())); | |
| 52 | - }else{ | |
| 53 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 54 | - System.err.println("字段【"+property.getName()+"】没有可匹配的自动转换类型"); | |
| 55 | - } | |
| 56 | - } | |
| 57 | - } | |
| 58 | - | |
| 59 | - public static Object transMap2Bean(Map<String, Object> map, Object obj) { | |
| 60 | - if(map==null || obj==null){ | |
| 61 | - return null; | |
| 62 | - } | |
| 63 | - try { | |
| 64 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 65 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 66 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 67 | - String key = property.getName(); | |
| 68 | - if (map.containsKey(key)) { | |
| 69 | - Object value = map.get(key); | |
| 70 | - invokeIgnoreType(property,value,obj); | |
| 71 | - } | |
| 72 | - } | |
| 73 | - } catch (Exception e) { | |
| 74 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 75 | - System.err.println("transMap2Bean Error " + e); | |
| 76 | - e.printStackTrace(); | |
| 77 | - } | |
| 78 | - return obj; | |
| 79 | - } | |
| 80 | - | |
| 81 | - public static Object transMap2AliasBean(Map<String, Object> map, Object obj, HashMap<String, String> keyMap) { | |
| 82 | - if(map==null || obj==null || keyMap==null){ | |
| 83 | - return null; | |
| 84 | - } | |
| 85 | - try { | |
| 86 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 87 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 88 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 89 | - String field = property.getName(); | |
| 90 | - if (keyMap.containsKey(field)) { | |
| 91 | - Object value = map.get(keyMap.get(field)); | |
| 92 | - invokeIgnoreType(property,value,obj); | |
| 93 | - } | |
| 94 | - } | |
| 95 | - } catch (Exception e) { | |
| 96 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 97 | - System.err.println("transMap2Bean Error " + e); | |
| 98 | - e.printStackTrace(); | |
| 99 | - } | |
| 100 | - return obj; | |
| 101 | - } | |
| 102 | - | |
| 103 | - // 自动处理时间字段和对应的字符串字段(Str结尾) | |
| 104 | - public static Object transMap2FormatBean(Map<String, Object> map, Object obj) { | |
| 105 | - if(map==null || obj==null){ | |
| 106 | - return null; | |
| 107 | - } | |
| 108 | - try { | |
| 109 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 110 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 111 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 112 | - String key = property.getName(); | |
| 113 | - Class<?> keyType = property.getPropertyType(); | |
| 114 | - // set当前字段 | |
| 115 | - if (map.containsKey(key)) { | |
| 116 | - Object value = map.get(key); | |
| 117 | - invokeIgnoreType(property,value,obj); | |
| 118 | - | |
| 119 | - /* | |
| 120 | - * 自动处理时间字段和对应的字符串字段(Str结尾) | |
| 121 | - */ | |
| 122 | - if (keyType.equals(String.class) && key.length() > 3 | |
| 123 | - && "Str".equals(key.substring(key.length() - 3))) {// key可能是格式化字段 | |
| 124 | - String dateKey = key.substring(0,key.length() - 3); | |
| 125 | - for (PropertyDescriptor dateProperty : propertyDescriptors) { | |
| 126 | - if (dateKey.equals(dateProperty.getName())) {// 找到了对应的日期字段,set之 | |
| 127 | - String dateValue = value.toString(); | |
| 128 | - if (dateValue.length() == 10) {// yyyy-MM-dd | |
| 129 | - dateProperty.getWriteMethod().invoke(obj, DateUtil.parseYMD(dateValue)); | |
| 130 | - } else if (dateValue.length() == 19) {// yyyy-MM-dd | |
| 131 | - // HH:mm:ss | |
| 132 | - dateProperty.getWriteMethod().invoke(obj, DateUtil.parseYMDHMS(dateValue)); | |
| 133 | - } | |
| 134 | - } | |
| 135 | - } | |
| 136 | - } | |
| 137 | - } | |
| 138 | - | |
| 139 | - } | |
| 140 | - } catch (Exception e) { | |
| 141 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 142 | - System.err.println("transMap2FormatBean Error " + e); | |
| 143 | - e.printStackTrace(); | |
| 144 | - } | |
| 145 | - return obj; | |
| 146 | - } | |
| 147 | - | |
| 148 | - public static Map<String, Object> transBean2Map(Object obj) { | |
| 149 | - if(obj==null){ | |
| 150 | - return null; | |
| 151 | - } | |
| 152 | - Map<String, Object> map = new HashMap<>(); | |
| 153 | - try { | |
| 154 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 155 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 156 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 157 | - String key = property.getName(); | |
| 158 | - // 过滤class属性 | |
| 159 | - if (!key.equals("class")) { | |
| 160 | - // 得到property对应的getter方法 | |
| 161 | - Method getter = property.getReadMethod(); | |
| 162 | - Object value = getter.invoke(obj); | |
| 163 | - map.put(key, value); | |
| 164 | - } | |
| 165 | - } | |
| 166 | - } catch (Exception e) { | |
| 167 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 168 | - System.err.println("transBean2Map Error " + e); | |
| 169 | - e.printStackTrace(); | |
| 170 | - } | |
| 171 | - return map; | |
| 172 | - } | |
| 173 | - | |
| 174 | - public static HashMap<String, String> getKeyMap(String[] original, String[] alias) { | |
| 175 | - int length = original.length; | |
| 176 | - if (length != alias.length) { | |
| 177 | - throw new RuntimeException("映射配置错误"); | |
| 178 | - } | |
| 179 | - HashMap<String, String> map = new HashMap<>(); | |
| 180 | - for (int i = 0; i < length; i++) { | |
| 181 | - map.put(original[i], alias[i]); | |
| 182 | - map.put(alias[i], original[i]); | |
| 183 | - } | |
| 184 | - /* | |
| 185 | - * 1--A(正常映射) 4--4(同名映射,允许) 2--C,C--3(错误映射) 错误的keyMap映射的value会有重复 | |
| 186 | - */ | |
| 187 | - Set<String> keySet = map.keySet(); | |
| 188 | - Set<String> valueSet = new HashSet<>(); | |
| 189 | - for (String key : keySet) { | |
| 190 | - valueSet.add(map.get(key)); | |
| 191 | - } | |
| 192 | - if (keySet.size() != valueSet.size()) { | |
| 193 | - throw new RuntimeException("映射配置错误"); | |
| 194 | - } | |
| 195 | - return map; | |
| 196 | - } | |
| 197 | - | |
| 198 | - public static Map<String, Object> transBean2AliasMap(Object obj, HashMap<String, String> keyMap) { | |
| 199 | - if(keyMap==null || obj==null){ | |
| 200 | - return null; | |
| 201 | - } | |
| 202 | - Map<String, Object> map = new HashMap<>(); | |
| 203 | - try { | |
| 204 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 205 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 206 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 207 | - String field = property.getName(); | |
| 208 | - // 过滤class属性 | |
| 209 | - if (!field.equals("class")) { | |
| 210 | - // 得到property对应的getter方法 | |
| 211 | - Method getter = property.getReadMethod(); | |
| 212 | - Object value = getter.invoke(obj); | |
| 213 | - if (keyMap.containsKey(field)) { | |
| 214 | - map.put(keyMap.get(field), value); | |
| 215 | - } | |
| 216 | - } | |
| 217 | - } | |
| 218 | - } catch (Exception e) { | |
| 219 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 220 | - System.err.println("transBean2AliasMap Error " + e); | |
| 221 | - e.printStackTrace(); | |
| 222 | - } | |
| 223 | - return map; | |
| 224 | - } | |
| 225 | - | |
| 226 | - public static Map<String, Object> transBean2FormatAliasMap(Object obj, HashMap<String, String> keyMap) { | |
| 227 | - if(keyMap==null || obj==null){ | |
| 228 | - return null; | |
| 229 | - } | |
| 230 | - Map<String, Object> map = new HashMap<>(); | |
| 231 | - try { | |
| 232 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 233 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 234 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 235 | - String field = property.getName(); | |
| 236 | - // Class<?> fieldType = property.getPropertyType(); | |
| 237 | - // 过滤class属性 | |
| 238 | - if (!field.equals("class")) { | |
| 239 | - // 得到property对应的getter方法 | |
| 240 | - Method getter = property.getReadMethod(); | |
| 241 | - Object value = getter.invoke(obj); | |
| 242 | - if (value instanceof Date) {// 自动格式化日期对象 | |
| 243 | - Date dateValue = (Date) value; | |
| 244 | - String str = DateUtil.getyyyy_MM_dd(dateValue);// getyyyy_MM_dd_hms | |
| 245 | - if (keyMap.get(field + "Str") != null) { | |
| 246 | - map.put(keyMap.get(field + "Str"), str); | |
| 247 | - } | |
| 248 | - } else {// 普通字段,别名存储 | |
| 249 | - if (keyMap.get(field) != null) { | |
| 250 | - if (map.get(keyMap.get(field)) == null) {// 如果被以上的格式化代码赋值过,则不再过问 | |
| 251 | - map.put(keyMap.get(field), value); | |
| 252 | - } | |
| 253 | - } | |
| 254 | - } | |
| 255 | - } | |
| 256 | - } | |
| 257 | - } catch (Exception e) { | |
| 258 | - System.err.println("映射"+obj.getClass().getName()+"对象时发生错误"); | |
| 259 | - System.err.println("transBean2FormatAliasMap Error " + e); | |
| 260 | - e.printStackTrace(); | |
| 261 | - } | |
| 262 | - return map; | |
| 263 | - } | |
| 264 | - | |
| 265 | -// public static void mappingAlias(Object original, Object alias, HashMap<String, String> keyMap) { | |
| 266 | -// Map<String, Object> aliasMap = transBean2AliasMap(original, keyMap); | |
| 267 | -// transMap2Bean(aliasMap, alias); | |
| 268 | -// } | |
| 269 | -// | |
| 270 | -// public static void mappingFormatAlias(Object original, Object alias, HashMap<String, String> keyMap) { | |
| 271 | -// Map<String, Object> aliasMap = transBean2FormatAliasMap(original, keyMap); | |
| 272 | -// transMap2FormatBean(aliasMap, alias); | |
| 273 | -// } | |
| 274 | - | |
| 275 | - /* | |
| 276 | - * 方便书写映射文件keyMap | |
| 277 | - */ | |
| 278 | - private static void printField(Object obj) { | |
| 279 | - try { | |
| 280 | - BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); | |
| 281 | - PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); | |
| 282 | - for (PropertyDescriptor property : propertyDescriptors) { | |
| 283 | - String key = property.getName(); | |
| 284 | - // 过滤class属性 | |
| 285 | - if (!key.equals("class")) { | |
| 286 | - System.out.println("\"" + key + "\",//");// "name", | |
| 287 | - } | |
| 288 | - } | |
| 289 | - } catch (Exception e) { | |
| 290 | - e.printStackTrace(); | |
| 291 | - } | |
| 292 | - } | |
| 293 | - | |
| 294 | - /* | |
| 295 | - * 方便书写 json | |
| 296 | - */ | |
| 297 | - private static void printJsonByArray(String[] args) { | |
| 298 | - System.out.println("{"); | |
| 299 | - for (int i = 0; i < args.length; i++) { | |
| 300 | - String str = "\"" + args[i] + "\":\"666\""; | |
| 301 | - if (i != args.length - 1) { | |
| 302 | - str += ","; | |
| 303 | - } | |
| 304 | - System.out.println(str); | |
| 305 | - } | |
| 306 | - System.out.println("}"); | |
| 307 | - } | |
| 308 | - | |
| 309 | - public static void main(String[] args) { | |
| 310 | - printField(new DiagnoseAssit()); | |
| 311 | -// printJsonByArray(WomanFetationRecordKeymap.alias); | |
| 312 | - } | |
| 313 | - | |
| 314 | -} |