Commit 17c8c539815c6096b5b47d6faa7cac20bafd8815
1 parent
c172d3091d
Exists in
master
and in
6 other branches
秦皇岛冠新公卫接口
Showing 4 changed files with 262 additions and 2 deletions
- platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/QhdJbgwController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
View file @
17c8c53
| ... | ... | @@ -30,6 +30,9 @@ |
| 30 | 30 | private Date createdTimeStart; |
| 31 | 31 | private Date createdTimeEnd; |
| 32 | 32 | |
| 33 | + private Date modifiedStart; | |
| 34 | + private Date modifiedEnd; | |
| 35 | + | |
| 33 | 36 | //大于修改时间 |
| 34 | 37 | private Date gteModified; |
| 35 | 38 | private Date gteCreated; |
| ... | ... | @@ -43,6 +46,22 @@ |
| 43 | 46 | |
| 44 | 47 | private boolean isOpinion; |
| 45 | 48 | |
| 49 | + public Date getModifiedStart() { | |
| 50 | + return modifiedStart; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setModifiedStart(Date modifiedStart) { | |
| 54 | + this.modifiedStart = modifiedStart; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public Date getModifiedEnd() { | |
| 58 | + return modifiedEnd; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setModifiedEnd(Date modifiedEnd) { | |
| 62 | + this.modifiedEnd = modifiedEnd; | |
| 63 | + } | |
| 64 | + | |
| 46 | 65 | public Date getCreatedTimeStart() { |
| 47 | 66 | return createdTimeStart; |
| 48 | 67 | } |
| ... | ... | @@ -255,6 +274,13 @@ |
| 255 | 274 | c = c.where("created").gte(createdTimeStart).lte(createdTimeEnd); |
| 256 | 275 | } else { |
| 257 | 276 | c = Criteria.where("created").gte(createdTimeStart).lte(createdTimeEnd); |
| 277 | + } | |
| 278 | + } | |
| 279 | + if (null != modifiedStart && modifiedEnd != null) { | |
| 280 | + if (null != c) { | |
| 281 | + c = c.where("modified").gte(modifiedStart).lte(modifiedEnd); | |
| 282 | + } else { | |
| 283 | + c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd); | |
| 258 | 284 | } |
| 259 | 285 | } |
| 260 | 286 |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java
View file @
17c8c53
| 1 | 1 | package com.lyms.hospitalapi.qhdfy; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.AntenatalExaminationService; | |
| 3 | 4 | import com.lyms.platform.biz.service.BasicConfigService; |
| 4 | 5 | import com.lyms.platform.biz.service.PatientsService; |
| 5 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| 6 | 7 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 7 | 9 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 10 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
| 8 | 11 | import com.lyms.platform.operate.web.utils.ResolveUtils; |
| 9 | 12 | import com.lyms.platform.permission.model.Organization; |
| 13 | +import com.lyms.platform.permission.model.Users; | |
| 10 | 14 | import com.lyms.platform.permission.service.OrganizationService; |
| 15 | +import com.lyms.platform.permission.service.UsersService; | |
| 16 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 11 | 17 | import com.lyms.platform.pojo.BasicConfig; |
| 12 | 18 | import com.lyms.platform.pojo.Patients; |
| 19 | +import com.lyms.platform.query.AntExChuQuery; | |
| 13 | 20 | import com.lyms.platform.query.PatientsQuery; |
| 21 | +import org.apache.commons.collections.MapUtils; | |
| 14 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | 23 | import org.springframework.stereotype.Service; |
| 16 | 24 | |
| 17 | 25 | |
| ... | ... | @@ -33,9 +41,13 @@ |
| 33 | 41 | private BasicConfigService basicConfigService; |
| 34 | 42 | @Autowired |
| 35 | 43 | private OrganizationService organizationService; |
| 44 | + @Autowired | |
| 45 | + private AntenatalExaminationService antExService; | |
| 46 | + @Autowired | |
| 47 | + private UsersService usersService; | |
| 36 | 48 | |
| 37 | 49 | /** |
| 38 | - * | |
| 50 | + *孕产登记 | |
| 39 | 51 | * @param startDate |
| 40 | 52 | * @param endDate |
| 41 | 53 | * @return |
| ... | ... | @@ -96,6 +108,214 @@ |
| 96 | 108 | return mList; |
| 97 | 109 | } |
| 98 | 110 | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * 初诊 | |
| 114 | + * @param startDate | |
| 115 | + * @param endDate | |
| 116 | + * @return | |
| 117 | + */ | |
| 118 | + public List<Map<String,String>> getChuZhen(String startDate,String endDate){ | |
| 119 | + List<Map<String,String>> mList = new ArrayList<Map<String,String>>(); | |
| 120 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 121 | + antExChuQuery.setModifiedStart(DateUtil.parseYMDHMS(startDate)); | |
| 122 | + antExChuQuery.setModifiedEnd(DateUtil.parseYMDHMS(endDate)); | |
| 123 | + List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery); | |
| 124 | + if(list != null && list.size() > 0){ | |
| 125 | + Patients patients = patientsService.findOnePatientById(list.get(0).getParentId()); | |
| 126 | + for(AntExChuModel antExChuModel : list){ | |
| 127 | + try{ | |
| 128 | + String cDueWeek = ResolveUtils.getPregnancyWeek(patients.getLastMenses(), antExChuModel.getCheckTime()); | |
| 129 | + int week = Integer.parseInt(cDueWeek.substring(1, cDueWeek.indexOf("周"))); | |
| 130 | + int day = Integer.parseInt(cDueWeek.substring(cDueWeek.indexOf("+")+1, cDueWeek.indexOf("天"))); | |
| 131 | + Map<String,String> map = new HashMap<String,String>(); | |
| 132 | + map.put("MATERNALFIRSTFOLLOWUPID",antExChuModel.getId()); | |
| 133 | + map.put("MATERNALINFOID",patients.getId()); | |
| 134 | + map.put("NAME",patients.getUsername()); | |
| 135 | + map.put("FOLLOWUPDATE",DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); | |
| 136 | + map.put("GESTWEEKS",String.valueOf(week)); | |
| 137 | + map.put("GESTDAYS",String.valueOf(day)); | |
| 138 | + map.put("AGE",DateUtil.getAge(patients.getBirth()).toString()); | |
| 139 | + map.put("HUSBANDNAME",patients.getHusbandName()); | |
| 140 | + map.put("HUSBANDTELNO",patients.getHusbandPhone()); | |
| 141 | + if(patients.getHusbandBirth() != null){ | |
| 142 | + map.put("HUSBANDAGE",DateUtil.getAge(patients.getHusbandBirth()).toString()); | |
| 143 | + } | |
| 144 | + if(patients.getHusbandBirth() != null){ | |
| 145 | + map.put("HUSBANDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getHusbandBirth())); | |
| 146 | + } | |
| 147 | + if(antExChuModel.getPregnancyTimes() != null){ | |
| 148 | + map.put("GRAVIDITY",antExChuModel.getPregnancyTimes().toString()); | |
| 149 | + } | |
| 150 | + if(antExChuModel.getDelivery() != null){ | |
| 151 | + map.put("VAGINALDELIVERYTIMES",antExChuModel.getDelivery().toString()); | |
| 152 | + } | |
| 153 | + if(antExChuModel.getPlanedProd() != null){ | |
| 154 | + map.put("CAESAREANDELIVERYTIMES",antExChuModel.getPlanedProd().toString()); | |
| 155 | + } | |
| 156 | + map.put("MENSESLASTDATE",DateUtil.getyyyy_MM_dd(patients.getLastMenses())); | |
| 157 | + map.put("EXPECTEDCHILDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 158 | + if(antExChuModel.getAbortion() != null){ | |
| 159 | + map.put("ABORTIONTIMES",antExChuModel.getAbortion().toString()); | |
| 160 | + } | |
| 161 | + if(antExChuModel.getStillChan() != null){ | |
| 162 | + map.put("STILLBIRTHNUM",antExChuModel.getStillChan().toString()); | |
| 163 | + } | |
| 164 | + if(antExChuModel.getStillbirth() != null){ | |
| 165 | + map.put("DEADFETUSNUM",antExChuModel.getStillbirth().toString()); | |
| 166 | + } | |
| 167 | + if(antExChuModel.getNeoDeath() != null){ | |
| 168 | + map.put("NEWBORNDEATHNUM",antExChuModel.getNeoDeath().toString()); | |
| 169 | + } | |
| 170 | + if(antExChuModel.getBirthDefect() != null){ | |
| 171 | + map.put("BIRTHDEFECTCOUNT",antExChuModel.getBirthDefect().toString()); | |
| 172 | + } | |
| 173 | + map.put("HEIGHT",antExChuModel.getHeight()); | |
| 174 | + map.put("WEIGHT",antExChuModel.getWeight()); | |
| 175 | + if(antExChuModel.getHeight() != null && antExChuModel.getWeight() != null){ | |
| 176 | + Double wh = Double.parseDouble(antExChuModel.getHeight()) / 100; | |
| 177 | + Double shen = wh * wh; | |
| 178 | + Double bmi = Double.parseDouble(antExChuModel.getWeight()) / shen; | |
| 179 | + map.put("BMI",bmi.toString()); | |
| 180 | + } | |
| 181 | + String ssy = ""; | |
| 182 | + String szy = ""; | |
| 183 | + Map<String, String> chBpMap = JsonUtil.getMap(antExChuModel.getBp()); | |
| 184 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
| 185 | + ssy = chBpMap.get("ssy"); | |
| 186 | + szy = chBpMap.get("szy"); | |
| 187 | + } | |
| 188 | + map.put("SBP",ssy); | |
| 189 | + map.put("DBP",szy); | |
| 190 | + if("未见异常".equals(antExChuModel.getLungs())){ | |
| 191 | + map.put("LUNGABNORMCODE","1"); | |
| 192 | + map.put("LUNGABNORMDESC",antExChuModel.getLungs()); | |
| 193 | + }else{ | |
| 194 | + map.put("LUNGABNORMCODE","2"); | |
| 195 | + map.put("LUNGABNORMDESC",antExChuModel.getLungs()); | |
| 196 | + } | |
| 197 | + if("未见异常".equals(antExChuModel.getHeart())){ | |
| 198 | + map.put("HEARTABNORMCODE","1"); | |
| 199 | + map.put("HEARTABNORMDESC",antExChuModel.getHeart()); | |
| 200 | + }else{ | |
| 201 | + map.put("HEARTABNORMCODE","2"); | |
| 202 | + map.put("HEARTABNORMDESC",antExChuModel.getHeart()); | |
| 203 | + } | |
| 204 | + if("未见异常".equals(antExChuModel.getVulva())){ | |
| 205 | + map.put("VULVAABNORMCODE","1"); | |
| 206 | + map.put("VULVAABNORMDESC",antExChuModel.getVulva()); | |
| 207 | + }else{ | |
| 208 | + map.put("VULVAABNORMCODE","2"); | |
| 209 | + map.put("VULVAABNORMDESC",antExChuModel.getVulva()); | |
| 210 | + } | |
| 211 | + if("未见异常".equals(antExChuModel.getVagina())){ | |
| 212 | + map.put("VAGINAABNORMCODE","1"); | |
| 213 | + map.put("VAGINAABNORMDESC",antExChuModel.getVagina()); | |
| 214 | + }else{ | |
| 215 | + map.put("VAGINAABNORMCODE","2"); | |
| 216 | + map.put("VAGINAABNORMDESC",antExChuModel.getVagina()); | |
| 217 | + } | |
| 218 | + if("未见异常".equals(antExChuModel.getCervical())){ | |
| 219 | + map.put("CERVIXABNORMCODE","1"); | |
| 220 | + map.put("CERVIXABNORMDESC",antExChuModel.getCervical()); | |
| 221 | + }else{ | |
| 222 | + map.put("CERVIXABNORMCODE","2"); | |
| 223 | + map.put("CERVIXABNORMDESC",antExChuModel.getCervical()); | |
| 224 | + } | |
| 225 | + if("未见异常".equals(antExChuModel.getUterus())){ | |
| 226 | + map.put("CORPUSUTERIABNORMDODE","1"); | |
| 227 | + map.put("CORPUSUTERIABNORMDESC",antExChuModel.getUterus()); | |
| 228 | + }else{ | |
| 229 | + map.put("CORPUSUTERIABNORMDODE","2"); | |
| 230 | + map.put("CORPUSUTERIABNORMDESC",antExChuModel.getUterus()); | |
| 231 | + } | |
| 232 | + if("未见异常".equals(antExChuModel.getFujian())){ | |
| 233 | + map.put("ADNEXAABNORMCODE","1"); | |
| 234 | + map.put("ADNEXAABNORMDESC",antExChuModel.getFujian()); | |
| 235 | + }else{ | |
| 236 | + map.put("ADNEXAABNORMCODE","2"); | |
| 237 | + map.put("ADNEXAABNORMDESC",antExChuModel.getFujian()); | |
| 238 | + } | |
| 239 | + map.put("HGB",antExChuModel.getXhdb()); | |
| 240 | + map.put("WBC",antExChuModel.getBxbjs()); | |
| 241 | + map.put("PLT",antExChuModel.getPlatelet()); | |
| 242 | + map.put("CBCOTHERS",antExChuModel.getChgOther()); | |
| 243 | + map.put("PROQUANTESTVALUE",antExChuModel.getNdb()); | |
| 244 | + map.put("GLUQUANTESTVALUE",antExChuModel.getNt()); | |
| 245 | + map.put("UOBTESTRESULTCODE",antExChuModel.getBld()); | |
| 246 | + map.put("URINEROUTINEOTHER",antExChuModel.getNcgOther()); | |
| 247 | + map.put("RHCODE",FunvCommonUtil.checkYiGan(antExChuModel.getRh())); | |
| 248 | + map.put("ABOCODE",FunvCommonUtil.getBaseicConfigByid(antExChuModel.getAbo(), basicConfigService)); | |
| 249 | + map.put("GLU",antExChuModel.getBloodSugar()); | |
| 250 | + map.put("SGPT",antExChuModel.getXqgbzam()); | |
| 251 | + map.put("AST",antExChuModel.getXqgczam()); | |
| 252 | + map.put("ALB",antExChuModel.getAlbumin()); | |
| 253 | + map.put("TBI",antExChuModel.getTotalBilirubin()); | |
| 254 | + if(antExChuModel.getJhBilirubin() != null && antExChuModel.getTotalBilirubin() != null){ | |
| 255 | + int jh = Integer.parseInt(antExChuModel.getTotalBilirubin()) - Integer.parseInt(antExChuModel.getJhBilirubin()); | |
| 256 | + map.put("DBIL",String.valueOf(jh)); | |
| 257 | + } | |
| 258 | + map.put("BUN",antExChuModel.getXnsd()); | |
| 259 | + map.put("SCR",antExChuModel.getXqjq()); | |
| 260 | + map.put("WVDCLEANCODE",null); | |
| 261 | + map.put("HBEABTESTRESULTCODE",antExChuModel.getYgekt()); | |
| 262 | + map.put("HBEAGTESTRESULTCODE",antExChuModel.getYgeky()); | |
| 263 | + map.put("HBSABTESTRESULTCODE",antExChuModel.getYgbmkt()); | |
| 264 | + map.put("HBSAGTESTRESULTCODE",antExChuModel.getYgbmky()); | |
| 265 | + map.put("HBCABTESTRESULTCODE",antExChuModel.getYghxkt()); | |
| 266 | + if("yin".equals(antExChuModel.getSyjg())){ | |
| 267 | + map.put("STSRESULTCODE","1"); | |
| 268 | + }else if("yang".equals(antExChuModel.getSyjg())){ | |
| 269 | + map.put("STSRESULTCODE","2"); | |
| 270 | + }else{ | |
| 271 | + map.put("STSRESULTCODE",null); | |
| 272 | + } | |
| 273 | + if("yin".equals(antExChuModel.getHivkt())){ | |
| 274 | + map.put("HIVANTIRESULTCODE","1"); | |
| 275 | + }else if("yang".equals(antExChuModel.getHivkt())){ | |
| 276 | + map.put("HIVANTIRESULTCODE","2"); | |
| 277 | + }else{ | |
| 278 | + map.put("HIVANTIRESULTCODE",null); | |
| 279 | + } | |
| 280 | + map.put("BSCANRESULTDESC",antExChuModel.getbChao()); | |
| 281 | + map.put("NEXTFOLLOWUPDATE",DateUtil.getyyyy_MM_dd(antExChuModel.getNextCheckTime())); | |
| 282 | + map.put("FOLLOWUPDOCTORID",antExChuModel.getProdDoctor()); | |
| 283 | + String checkDoctor = ""; | |
| 284 | + | |
| 285 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getProdDoctor())) { | |
| 286 | + Users users = usersService.getUsers(Integer.parseInt(antExChuModel.getProdDoctor())); | |
| 287 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
| 288 | + checkDoctor = users.getName(); | |
| 289 | + } | |
| 290 | + } | |
| 291 | + map.put("FOLLOWUPDOCTORNAME",checkDoctor); | |
| 292 | + String ydfmw = ""; | |
| 293 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getYdfmw())) | |
| 294 | + | |
| 295 | + { | |
| 296 | + Map ydfmwMap = JsonUtil.str2Obj(antExChuModel.getYdfmw(), Map.class); | |
| 297 | + ydfmw = ResolveUtils.replaceYDFMW(ydfmwMap, 1); | |
| 298 | + } | |
| 299 | + map.put("WVDEXAM",ydfmw); | |
| 300 | + map.put("ORGCODE",patients.getHospitalId()); | |
| 301 | + String hospital = ""; | |
| 302 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { | |
| 303 | + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); | |
| 304 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
| 305 | + hospital = organization.getName(); | |
| 306 | + } | |
| 307 | + } | |
| 308 | + map.put("ORGNAME",hospital); | |
| 309 | + mList.add(map); | |
| 310 | + }catch (Exception e){ | |
| 311 | + e.printStackTrace(); | |
| 312 | + continue; | |
| 313 | + } | |
| 314 | + } | |
| 315 | + } | |
| 316 | + | |
| 317 | + return mList; | |
| 318 | + } | |
| 99 | 319 | |
| 100 | 320 | |
| 101 | 321 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/QhdJbgwController.java
View file @
17c8c53
| ... | ... | @@ -31,5 +31,19 @@ |
| 31 | 31 | return null; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + @RequestMapping(method = RequestMethod.POST,value = "/qhd/cz") | |
| 38 | + @ResponseBody | |
| 39 | + public List<Map<String,String>> qhdChuZhen(@RequestBody Map<String,String> map){ | |
| 40 | + if(StringUtils.isNotEmpty(map.get("startDate")) && StringUtils.isNotEmpty(map.get("endDate"))){ | |
| 41 | + return qhdJbgwInterface.getChuZhen(map.get("startDate"),map.get("endDate")); | |
| 42 | + } | |
| 43 | + return null; | |
| 44 | + } | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 34 | 48 | } |