Commit d2bcf3644560d09d1e137bf4e141537fca53add4
1 parent
160b38c795
Exists in
master
and in
6 other branches
更新
Showing 8 changed files with 1344 additions and 9 deletions
- platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/ConnTools.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyFmService.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyHisService.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/resources/config.properties
platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/ConnTools.java
View file @
d2bcf36
| 1 | +package com.lyms.hospitalapi.dzfy; | |
| 2 | + | |
| 3 | +import java.sql.Connection; | |
| 4 | +import java.sql.DriverManager; | |
| 5 | +import java.sql.SQLException; | |
| 6 | + | |
| 7 | +/**gxk | |
| 8 | + * 德州妇幼 | |
| 9 | + * Created by Administrator on 2017/4/12. | |
| 10 | + */ | |
| 11 | +public class ConnTools { | |
| 12 | + private static String hisDirverClassName = "oracle.jdbc.driver.OracleDriver"; | |
| 13 | + private static String hisUrl = "jdbc:oracle:thin:@192.168.200.60:1521:ZLHIS"; | |
| 14 | + private static String hisUser = "YCY"; | |
| 15 | + private static String hisPassword = "123"; | |
| 16 | + | |
| 17 | + | |
| 18 | + public static Connection makeHisConnection() { | |
| 19 | + Connection conn = null; | |
| 20 | + try { | |
| 21 | + Class.forName(hisDirverClassName); | |
| 22 | + } catch (ClassNotFoundException e) { | |
| 23 | + e.printStackTrace(); | |
| 24 | + } | |
| 25 | + try { | |
| 26 | + conn = DriverManager.getConnection(hisUrl, hisUser, hisPassword); | |
| 27 | + } catch (SQLException e) { | |
| 28 | + e.printStackTrace(); | |
| 29 | + } | |
| 30 | + return conn; | |
| 31 | + } | |
| 32 | + | |
| 33 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyFmService.java
View file @
d2bcf36
| 1 | +package com.lyms.hospitalapi.dzfy; | |
| 2 | + | |
| 3 | +import com.lyms.hospitalapi.qhdfy.*; | |
| 4 | +import com.lyms.hospitalapi.qhdfy.ConnTools; | |
| 5 | +import com.lyms.platform.biz.service.PatientsService; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 7 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 8 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 9 | +import com.lyms.platform.common.enums.*; | |
| 10 | +import com.lyms.platform.common.utils.DateUtil; | |
| 11 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 12 | +import com.lyms.platform.common.utils.StringUtils; | |
| 13 | +import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade; | |
| 14 | +import com.lyms.platform.operate.web.facade.MatDeliverFacade; | |
| 15 | +import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest; | |
| 16 | +import com.lyms.platform.operate.web.request.MatDeliverAddRequest; | |
| 17 | +import com.lyms.platform.permission.model.Users; | |
| 18 | +import com.lyms.platform.permission.model.UsersQuery; | |
| 19 | +import com.lyms.platform.permission.service.UsersService; | |
| 20 | +import com.lyms.platform.pojo.FmRecordModel; | |
| 21 | +import com.lyms.platform.pojo.MaternalDeliverModel; | |
| 22 | +import com.lyms.platform.pojo.Patients; | |
| 23 | +import com.lyms.platform.query.PatientsQuery; | |
| 24 | +import org.apache.commons.collections.CollectionUtils; | |
| 25 | +import org.apache.commons.dbutils.DbUtils; | |
| 26 | +import org.apache.commons.dbutils.QueryRunner; | |
| 27 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
| 28 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 29 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 30 | +import org.springframework.stereotype.Service; | |
| 31 | + | |
| 32 | +import java.sql.Connection; | |
| 33 | +import java.sql.SQLException; | |
| 34 | +import java.text.DecimalFormat; | |
| 35 | +import java.text.ParseException; | |
| 36 | +import java.text.SimpleDateFormat; | |
| 37 | +import java.util.*; | |
| 38 | + | |
| 39 | +/** | |
| 40 | + * Created by Administrator on 2017/4/14. | |
| 41 | + * 德州分娩接口对接医院 | |
| 42 | + */ | |
| 43 | +@Service("dzfyFmService") | |
| 44 | +public class DzfyFmService { | |
| 45 | + | |
| 46 | + @Autowired | |
| 47 | + private PatientsService patientsService; | |
| 48 | + | |
| 49 | + @Autowired | |
| 50 | + private MatDeliverFacade matDeliverFacade; | |
| 51 | + | |
| 52 | + @Autowired | |
| 53 | + private UsersService usersService; | |
| 54 | + | |
| 55 | + @Autowired | |
| 56 | + private BabyBookbuildingFacade babyBookbuildingFacade; | |
| 57 | + | |
| 58 | + @Autowired | |
| 59 | + private QhdfyHisService qhdfyHisService; | |
| 60 | + | |
| 61 | + private static Map<Integer, String> ONE_ENUMS = new HashMap<>(); | |
| 62 | + | |
| 63 | + private static Map<String, List> babyMap = new HashMap<>(); | |
| 64 | + | |
| 65 | + static { | |
| 66 | + ONE_ENUMS.put(0, "长"); | |
| 67 | + ONE_ENUMS.put(1, "次"); | |
| 68 | + ONE_ENUMS.put(2, "三"); | |
| 69 | + ONE_ENUMS.put(3, "四"); | |
| 70 | + ONE_ENUMS.put(4, "五"); | |
| 71 | + ONE_ENUMS.put(5, "六"); | |
| 72 | + ONE_ENUMS.put(6, "七"); | |
| 73 | + | |
| 74 | + | |
| 75 | + List<String> b1 = new ArrayList<>(); | |
| 76 | + b1.add("长女"); | |
| 77 | + b1.add("次女"); | |
| 78 | + babyMap.put("00", b1); | |
| 79 | + | |
| 80 | + List<String> b2 = new ArrayList<>(); | |
| 81 | + b2.add("长子"); | |
| 82 | + b2.add("次子"); | |
| 83 | + babyMap.put("11", b2); | |
| 84 | + | |
| 85 | + List<String> b3 = new ArrayList<>(); | |
| 86 | + b3.add("之子"); | |
| 87 | + b3.add("之女"); | |
| 88 | + | |
| 89 | + List<String> b4 = new ArrayList<>(); | |
| 90 | + b4.add("之女"); | |
| 91 | + b4.add("之子"); | |
| 92 | + babyMap.put("01", b4); | |
| 93 | + babyMap.put("10", b3); | |
| 94 | + List<String> b5 = new ArrayList<>(); | |
| 95 | + b5.add("之子"); | |
| 96 | + List<String> b6 = new ArrayList<>(); | |
| 97 | + b6.add("之女"); | |
| 98 | + | |
| 99 | + babyMap.put("1", b5); | |
| 100 | + babyMap.put("0", b6); | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void fmTimerWork() { | |
| 104 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 105 | + Date end = new Date(); | |
| 106 | + Date start = new Date(end.getTime()-1000*60*60); | |
| 107 | + String startStr = fmt.format(start); | |
| 108 | + String endStr = fmt.format(end); | |
| 109 | + System.out.println("start="+startStr+"end="+endStr); | |
| 110 | + ExceptionUtils.catchException("start=" + startStr + "end=" + endStr); | |
| 111 | + queryFmPatient(startStr, endStr,null); | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void syncWorker(String startStr,String endStr) { | |
| 115 | + System.out.println("sync start="+startStr+"end="+endStr); | |
| 116 | + ExceptionUtils.catchException("start="+startStr+"end="+endStr); | |
| 117 | + queryFmPatient(startStr, endStr,null); | |
| 118 | + } | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * 处理以前没有基本信息的记录 | |
| 122 | + */ | |
| 123 | + public void handleHistorData() | |
| 124 | + { | |
| 125 | + | |
| 126 | + Date birthEnd = new Date(); | |
| 127 | + Date birthStart = new Date(birthEnd.getTime()-1000*60*60*24*30); | |
| 128 | + | |
| 129 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 130 | + Criteria c = null; | |
| 131 | + if (null != birthStart) { | |
| 132 | + c = Criteria.where("time").gte(birthStart); | |
| 133 | + } | |
| 134 | + | |
| 135 | + if (null != birthEnd) { | |
| 136 | + if (null != c) { | |
| 137 | + c = c.lte(birthEnd); | |
| 138 | + } else { | |
| 139 | + c = Criteria.where("time").lte(birthEnd); | |
| 140 | + } | |
| 141 | + } | |
| 142 | + | |
| 143 | + MongoQuery query = new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
| 144 | + | |
| 145 | + List<FmRecordModel> list = babyBookbuildingFacade.queryFmHistoryData(query); | |
| 146 | + if (CollectionUtils.isNotEmpty(list)) | |
| 147 | + { | |
| 148 | + SimpleDateFormat formt = new SimpleDateFormat("yyyy-MM-dd"); | |
| 149 | + String start = null; | |
| 150 | + try { | |
| 151 | + start = formt.format(formt.parse("2000-01-01")); | |
| 152 | + } catch (ParseException e) { | |
| 153 | + e.printStackTrace(); | |
| 154 | + } | |
| 155 | + String end = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 156 | + for (FmRecordModel fm : list) | |
| 157 | + { | |
| 158 | + queryFmPatient(start,end,fm.getSyxh()); | |
| 159 | + } | |
| 160 | + } | |
| 161 | + | |
| 162 | + } | |
| 163 | + | |
| 164 | + /** | |
| 165 | + * 删除历史分娩记录 | |
| 166 | + * @param syxh | |
| 167 | + */ | |
| 168 | + private void deleteFmHistoryRecord(String syxh) | |
| 169 | + { | |
| 170 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 171 | + condition = condition.and("syxh", syxh, MongoOper.IS); | |
| 172 | + babyBookbuildingFacade.deleteFmHistoryRecord(condition.toMongoQuery()); | |
| 173 | + } | |
| 174 | + | |
| 175 | + public void syncByPhone(String startStr,String endStr,String syxh) { | |
| 176 | + queryFmPatient(startStr, endStr,syxh); | |
| 177 | + } | |
| 178 | + | |
| 179 | + public void queryFmPatient(String start,String end,String syxh) { | |
| 180 | + | |
| 181 | + String cloumns = " ID as syxh,\n" + | |
| 182 | + // " YEXH as yexh,\n" + | |
| 183 | + // " JLRQ as jlrq,\t\n" + | |
| 184 | + " SSRQ as ssrq,\n" + | |
| 185 | + " SSJ as ssj,\n" + | |
| 186 | + " yexb as yexb,\n" + | |
| 187 | + " RC as rc,\n" + | |
| 188 | + " JTS as jts,\n" + | |
| 189 | + " DJT as djt,\n" + | |
| 190 | + " CJC as cjc,\n" + | |
| 191 | + " ZX as zx,\n" + | |
| 192 | + " TZ as tz,\n" + | |
| 193 | + " SC as sc,\n" + | |
| 194 | + " SH as sh,\n" + | |
| 195 | + " JX as jx,\n" + | |
| 196 | + " YFZ as yfz,\n" + | |
| 197 | + " WFZ as wfz,\n" + | |
| 198 | + " SFZ as sfz,\n" + | |
| 199 | + " PFZ as pfz,\n" + | |
| 200 | + " CCQK as ccqk,\n" + | |
| 201 | + " FMFS as fmfs,\n" + | |
| 202 | + " TPMCFS as tpmcfs,\n" + | |
| 203 | + " YEQK as yeqk,\n" + | |
| 204 | + " SW as sw,\n" + | |
| 205 | + " SFFQ as sffq,\n" + | |
| 206 | + " FQYY as fqyy,\n" + | |
| 207 | + " HYQK as hyqk,\n" + | |
| 208 | + " HYQK1 as hyqk1,\n" + | |
| 209 | + " YC as yc,\n" + | |
| 210 | + " SFGW as sfgw,\n" + | |
| 211 | + " MCTPSLXL as mctpslxl,\n" + | |
| 212 | + " CHEXXSXL as chexxsxl,\n" + | |
| 213 | + " QJQK as qjqk,\n" + | |
| 214 | + " SRKS as srks,\n" + | |
| 215 | + " JSZ as jsz"; | |
| 216 | + | |
| 217 | + Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeFmConnection(); | |
| 218 | + QueryRunner queryRunner = new QueryRunner(); | |
| 219 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHH:mm:ss"); | |
| 220 | + SimpleDateFormat fmt2 = new SimpleDateFormat("yyyyMMdd"); | |
| 221 | + SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 222 | + try { | |
| 223 | + String sql ="select "+cloumns+" from JHMK_FMJL where " + | |
| 224 | + " CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)" + | |
| 225 | + " and SYXH not in (select SYXH from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and SH is not null and CCQK is not null and CCQK <> '' " + | |
| 226 | + " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ')) "; | |
| 227 | + | |
| 228 | + if (StringUtils.isNotEmpty(syxh)) | |
| 229 | + { | |
| 230 | + sql+= " and SYXH='"+syxh+"'"; | |
| 231 | + } | |
| 232 | + | |
| 233 | + List<FmItem> list = queryRunner.query(conn, sql, new BeanListHandler<FmItem>(FmItem.class)); | |
| 234 | + ExceptionUtils.catchException("size====" + list.size()); | |
| 235 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 236 | + for (FmItem item : list) { | |
| 237 | + try { | |
| 238 | + | |
| 239 | + if (!("活产".equals(item.getCcqk()) || "死胎".equals(item.getCcqk()))) | |
| 240 | + { | |
| 241 | + continue; | |
| 242 | + } | |
| 243 | + ExceptionUtils.catchException("item===" + item); | |
| 244 | + String dueDateStr = item.getSsrq(); | |
| 245 | + if (!StringUtils.isNotEmpty(dueDateStr)) { | |
| 246 | + continue; | |
| 247 | + } | |
| 248 | + Date dueDate = null; | |
| 249 | + try{ | |
| 250 | + dueDate = fmt2.parse(dueDateStr); | |
| 251 | + }catch (Exception e) | |
| 252 | + { | |
| 253 | + dueDate = fmt.parse(dueDateStr); | |
| 254 | + } | |
| 255 | + | |
| 256 | + | |
| 257 | + FmPatInfo patInfo = getFmPatInfoById(item.getSyxh()); | |
| 258 | + if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone())) { | |
| 259 | + PatientsQuery query = new PatientsQuery(); | |
| 260 | + query.setYn(YnEnums.YES.getId()); | |
| 261 | + query.setType(1); //孕妇 | |
| 262 | + query.setDueStatus(0); //未终止妊娠 | |
| 263 | + ExceptionUtils.catchException("phone="+patInfo.getPhone()+" cardNo="+ patInfo.getCardNo()); | |
| 264 | + String[] strs = new String[]{patInfo.getPhone(),patInfo.getCardNo()}; | |
| 265 | + query.setPc(strs); | |
| 266 | + List<Patients> patientses = patientsService.queryPatient(query); | |
| 267 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 268 | + ExceptionUtils.catchException("patientses"+patientses); | |
| 269 | + Patients patient = patientses.get(0); | |
| 270 | + UsersQuery usersQuery = new UsersQuery(); | |
| 271 | + usersQuery.setName(item.getJsz()); | |
| 272 | + usersQuery.setYn(YnEnums.YES.getId()); | |
| 273 | + usersQuery.setOrgId(216); | |
| 274 | + List<Users> users = usersService.queryUsers(usersQuery); | |
| 275 | + if (!CollectionUtils.isNotEmpty(users)) { | |
| 276 | + usersQuery.setName("产房"); | |
| 277 | + users = usersService.queryUsers(usersQuery); | |
| 278 | + } | |
| 279 | + | |
| 280 | + if (CollectionUtils.isNotEmpty(users) && users.get(0).getId() != null) { | |
| 281 | + MatDeliverAddRequest deliverAddRequest = new MatDeliverAddRequest(); | |
| 282 | + | |
| 283 | + if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(item.getSsrq())) { | |
| 284 | + continue; | |
| 285 | + } | |
| 286 | + deliverAddRequest.setDeliverDoctor(users.get(0).getId()+""); | |
| 287 | + deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
| 288 | + deliverAddRequest.setParentId(patient.getId()); | |
| 289 | + deliverAddRequest.setPid(patient.getPid()); | |
| 290 | + deliverAddRequest.setOperationCause("-"); | |
| 291 | + String week = ""; | |
| 292 | + if (StringUtils.isNotEmpty(item.getRc())) { | |
| 293 | + | |
| 294 | + week = item.getRc() + "周"; | |
| 295 | + if (StringUtils.isNotEmpty(item.getRc()) && StringUtils.isNotEmpty(item.getJts())) | |
| 296 | + { | |
| 297 | + week += item.getJts() + "天"; | |
| 298 | + } | |
| 299 | + | |
| 300 | + deliverAddRequest.setDueWeek(week); | |
| 301 | + } | |
| 302 | + | |
| 303 | + deliverAddRequest.setTireNumber(1);// 胎数 | |
| 304 | + deliverAddRequest.setPlacenta("1");// 胎盘 | |
| 305 | + | |
| 306 | + if ("完好".equals(item.getHyqk()) || "无".equals(item.getHyqk())) { | |
| 307 | + deliverAddRequest.setPerinealCondition("full"); | |
| 308 | + } else if ("会阴切开".equals(item.getHyqk()) || "侧切".equals(item.getHyqk())) { | |
| 309 | + deliverAddRequest.setPerinealCondition("split"); | |
| 310 | + } | |
| 311 | + | |
| 312 | + if ("一度裂伤".equals(item.getHyqk())) { | |
| 313 | + deliverAddRequest.setSiLielevel(1); | |
| 314 | + } else if ("二度裂伤".equals(item.getHyqk())) { | |
| 315 | + deliverAddRequest.setSiLielevel(2); | |
| 316 | + } else if ("三度裂伤".equals(item.getHyqk())) { | |
| 317 | + deliverAddRequest.setSiLielevel(3); | |
| 318 | + } | |
| 319 | + | |
| 320 | + if (StringUtils.isNotEmpty(item.getChexxsxl())) { | |
| 321 | + deliverAddRequest.settHloseBloodL(Double.parseDouble(item.getChexxsxl())); | |
| 322 | + } | |
| 323 | + | |
| 324 | + Map deliveryMode = new HashMap(); //分娩方式 | |
| 325 | + | |
| 326 | + String fmfs = ""; | |
| 327 | + if (item.getFmfs() != null && "剖宫产".equals(item.getFmfs())) | |
| 328 | + { | |
| 329 | + fmfs = FmTypeEnums.O1.getId(); | |
| 330 | + } | |
| 331 | + else | |
| 332 | + { | |
| 333 | + fmfs = FmTypeEnums.O.getId(); | |
| 334 | + } | |
| 335 | + deliveryMode.put("fmfs",fmfs); | |
| 336 | + deliverAddRequest.setDeliveryMode(deliveryMode); | |
| 337 | + //胎盘信息 | |
| 338 | + List<MaternalDeliverModel.ExtPlacenta> extPlacentas = new ArrayList<>(); | |
| 339 | + MaternalDeliverModel.ExtPlacenta extPlacenta = new MaternalDeliverModel.ExtPlacenta(); | |
| 340 | + String tpmcType = ""; //胎盘娩出方式 | |
| 341 | + if ("手术产".equals(item.getTpmcfs()) || "手取胎盘".equals(item.getTpmcfs())) { | |
| 342 | + tpmcType = TpmcTypeEnums.O2.getId(); | |
| 343 | + } else if ("自然产出".equals(item.getTpmcfs()) || "自然娩出".equals(item.getTpmcfs())) { | |
| 344 | + tpmcType = TpmcTypeEnums.O.getId(); | |
| 345 | + } | |
| 346 | + extPlacenta.setTpmcType(tpmcType); | |
| 347 | + extPlacentas.add(extPlacenta); | |
| 348 | + deliverAddRequest.setExtPlacentas(extPlacentas); | |
| 349 | + | |
| 350 | + | |
| 351 | + //儿童 | |
| 352 | + List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); | |
| 353 | + MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); | |
| 354 | + Map<String, String> as = new HashMap<>(); | |
| 355 | + as.put("pf1", item.getYfz()); | |
| 356 | + as.put("pf5", item.getWfz()); | |
| 357 | + as.put("pf10", item.getSfz()); | |
| 358 | + baby.setApgarScore(as); | |
| 359 | + baby.setBabyGender("男".equals(item.getYexb()) ? "1" : "0"); | |
| 360 | + baby.setBabyHeight(item.getSc());//新生儿生长 | |
| 361 | + baby.setBabyWeight(item.getTz());//新生儿重量 | |
| 362 | + baby.setDeformity("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 | |
| 363 | + baby.setAsphyxiaM(item.getZx()); //窒息分钟 | |
| 364 | + baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(item.getCcqk())); // 妊娠结局 | |
| 365 | + baby.setDueTime(fmt1.format(dueDate));//分娩时间 | |
| 366 | + babies.add(baby); | |
| 367 | + deliverAddRequest.setBabies(babies); | |
| 368 | + deliverAddRequest.setFmHospital("216"); //设置为秦皇岛分娩医院 | |
| 369 | + ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest); | |
| 370 | + matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
| 371 | + deleteFmHistoryRecord(item.getSyxh()); | |
| 372 | + } | |
| 373 | + | |
| 374 | + } | |
| 375 | + else | |
| 376 | + { //秦皇岛服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据 | |
| 377 | + String babyName = patInfo.getName()+("男".equals(item.getYexb()) ? "之子" : "之女"); | |
| 378 | + buildBaby( item, patInfo, dueDate,babyName); | |
| 379 | + } | |
| 380 | + } | |
| 381 | + else | |
| 382 | + { | |
| 383 | + //没有找到孕妇建档的基本信息 记录下来 | |
| 384 | + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH:mm:ss"); | |
| 385 | + saveFmrecord(item.getSyxh(),format.parse(item.getJlrq())); | |
| 386 | + } | |
| 387 | + | |
| 388 | + } catch (Exception e) | |
| 389 | + { | |
| 390 | + ExceptionUtils.catchException(e, "数据异常"); | |
| 391 | + continue; | |
| 392 | + } | |
| 393 | + } | |
| 394 | + } | |
| 395 | + | |
| 396 | + String sql1="select "+cloumns+" from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and CCQK is not null and CCQK <> '' " + | |
| 397 | + " and SH is not null and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ') and " + | |
| 398 | + " CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)"; | |
| 399 | + | |
| 400 | + if (StringUtils.isNotEmpty(syxh)) | |
| 401 | + { | |
| 402 | + sql1+= " and SYXH='"+syxh+"'"; | |
| 403 | + } | |
| 404 | + | |
| 405 | + | |
| 406 | + List<FmItem> duoTaiList = queryRunner.query(conn,sql1 | |
| 407 | + , new BeanListHandler<FmItem>(FmItem.class)); | |
| 408 | + | |
| 409 | + if (CollectionUtils.isNotEmpty(duoTaiList)) { | |
| 410 | + Map<String,List<FmItem>> maps = new HashMap<>(); | |
| 411 | + for(FmItem item : duoTaiList) | |
| 412 | + { | |
| 413 | + if (maps.containsKey(item.getSyxh())) | |
| 414 | + { | |
| 415 | + maps.get(item.getSyxh()).add(item); | |
| 416 | + } | |
| 417 | + else | |
| 418 | + { | |
| 419 | + List items = new ArrayList<FmItem>(); | |
| 420 | + items.add(item); | |
| 421 | + maps.put(item.getSyxh(),items); | |
| 422 | + } | |
| 423 | + | |
| 424 | + } | |
| 425 | + if (maps.size() > 0) | |
| 426 | + { | |
| 427 | + for(String key : maps.keySet()) | |
| 428 | + { | |
| 429 | + List<FmItem> items = maps.get(key); | |
| 430 | + FmItem item = items.get(0); | |
| 431 | + | |
| 432 | + if (!("活产".equals(item.getCcqk()) || "死胎".equals(item.getCcqk()))) | |
| 433 | + { | |
| 434 | + continue; | |
| 435 | + } | |
| 436 | + | |
| 437 | + String dueDateStr = item.getSsrq(); | |
| 438 | + if (!StringUtils.isNotEmpty(dueDateStr)) | |
| 439 | + { | |
| 440 | + continue; | |
| 441 | + } | |
| 442 | + Date dueDate = null; | |
| 443 | + try{ | |
| 444 | + dueDate = fmt2.parse(dueDateStr); | |
| 445 | + }catch (Exception e) | |
| 446 | + { | |
| 447 | + dueDate = fmt.parse(dueDateStr); | |
| 448 | + } | |
| 449 | + FmPatInfo patInfo = getFmPatInfoById(item.getSyxh()); | |
| 450 | + if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone())) | |
| 451 | + { | |
| 452 | + PatientsQuery query = new PatientsQuery(); | |
| 453 | + query.setYn(YnEnums.YES.getId()); | |
| 454 | + query.setType(1); //孕妇 | |
| 455 | + query.setDueStatus(0); //未终止妊娠 | |
| 456 | + String[] strs = new String[]{patInfo.getPhone(),patInfo.getCardNo()}; | |
| 457 | + query.setPc(strs); | |
| 458 | + List<Patients> patientses = patientsService.queryPatient(query); | |
| 459 | + if (CollectionUtils.isNotEmpty(patientses)) | |
| 460 | + { | |
| 461 | + Patients patient = patientses.get(0); | |
| 462 | + | |
| 463 | + UsersQuery usersQuery = new UsersQuery(); | |
| 464 | + usersQuery.setName(item.getJsz()); | |
| 465 | + usersQuery.setYn(YnEnums.YES.getId()); | |
| 466 | + usersQuery.setOrgId(216); | |
| 467 | + List<Users> users = usersService.queryUsers(usersQuery); | |
| 468 | + | |
| 469 | + if (!CollectionUtils.isNotEmpty(users)) | |
| 470 | + { | |
| 471 | + usersQuery.setName("产房"); | |
| 472 | + users = usersService.queryUsers(usersQuery); | |
| 473 | + } | |
| 474 | + | |
| 475 | + if (CollectionUtils.isNotEmpty(users) && users.get(0).getId() != null) | |
| 476 | + { | |
| 477 | + MatDeliverAddRequest deliverAddRequest = new MatDeliverAddRequest(); | |
| 478 | + | |
| 479 | + if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(item.getSsrq())) | |
| 480 | + { | |
| 481 | + continue; | |
| 482 | + } | |
| 483 | + | |
| 484 | + deliverAddRequest.setDeliverDoctor(users.get(0).getId()+""); | |
| 485 | + deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
| 486 | + deliverAddRequest.setParentId(patient.getId()); | |
| 487 | + deliverAddRequest.setPid(patient.getPid()); | |
| 488 | + deliverAddRequest.setOperationCause("-"); | |
| 489 | + if (StringUtils.isNotEmpty(item.getRc())) | |
| 490 | + { | |
| 491 | + String week = ""; | |
| 492 | + | |
| 493 | + week = item.getRc() + "周"; | |
| 494 | + if (StringUtils.isNotEmpty(item.getRc()) && StringUtils.isNotEmpty(item.getJts())) | |
| 495 | + { | |
| 496 | + week += item.getJts() + "天"; | |
| 497 | + } | |
| 498 | + | |
| 499 | + deliverAddRequest.setDueWeek(week); | |
| 500 | + } | |
| 501 | + | |
| 502 | + deliverAddRequest.setTireNumber(items.size()); | |
| 503 | + deliverAddRequest.setPlacenta("1"); | |
| 504 | + | |
| 505 | + if ("完好".equals(item.getHyqk())) | |
| 506 | + { | |
| 507 | + deliverAddRequest.setPerinealCondition("full"); | |
| 508 | + } | |
| 509 | + else if ("会阴切开".equals(item.getHyqk())) | |
| 510 | + { | |
| 511 | + deliverAddRequest.setPerinealCondition("split"); | |
| 512 | + } | |
| 513 | + | |
| 514 | + if ("一度裂伤".equals(item.getHyqk())) | |
| 515 | + { | |
| 516 | + deliverAddRequest.setSiLielevel(1); | |
| 517 | + } | |
| 518 | + else if ("二度裂伤".equals(item.getHyqk())) | |
| 519 | + { | |
| 520 | + deliverAddRequest.setSiLielevel(2); | |
| 521 | + } | |
| 522 | + else if ("三度裂伤".equals(item.getHyqk())) | |
| 523 | + { | |
| 524 | + deliverAddRequest.setSiLielevel(3); | |
| 525 | + } | |
| 526 | + | |
| 527 | + if (StringUtils.isNotEmpty(item.getChexxsxl())) | |
| 528 | + { | |
| 529 | + deliverAddRequest.settHloseBloodL(Double.parseDouble(item.getChexxsxl())); | |
| 530 | + } | |
| 531 | + | |
| 532 | + //胎盘信息 | |
| 533 | + List<MaternalDeliverModel.ExtPlacenta> extPlacentas = new ArrayList<>(); | |
| 534 | + List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); | |
| 535 | + | |
| 536 | + | |
| 537 | + for (FmItem item1 : items) | |
| 538 | + { | |
| 539 | + | |
| 540 | + String dueDateStr1 = item1.getSsrq(); | |
| 541 | + if (!StringUtils.isNotEmpty(dueDateStr1)) | |
| 542 | + { | |
| 543 | + continue; | |
| 544 | + } | |
| 545 | + Date dueDate1 = null; | |
| 546 | + try{ | |
| 547 | + dueDate1 = fmt2.parse(dueDateStr); | |
| 548 | + }catch (Exception e) | |
| 549 | + { | |
| 550 | + dueDate1 = fmt.parse(dueDateStr); | |
| 551 | + } | |
| 552 | + | |
| 553 | + Map deliveryMode = new HashMap(); //分娩方式 | |
| 554 | + | |
| 555 | + String fmfs = ""; | |
| 556 | + if (item.getFmfs() != null && "剖宫产".equals(item.getFmfs())) | |
| 557 | + { | |
| 558 | + fmfs = FmTypeEnums.O1.getId(); | |
| 559 | + } | |
| 560 | + else | |
| 561 | + { | |
| 562 | + fmfs = FmTypeEnums.O.getId(); | |
| 563 | + } | |
| 564 | + deliveryMode.put("fmfs",fmfs); | |
| 565 | + deliverAddRequest.setDeliveryMode(deliveryMode); | |
| 566 | + | |
| 567 | + MaternalDeliverModel.ExtPlacenta extPlacenta = new MaternalDeliverModel.ExtPlacenta(); | |
| 568 | + String tpmcType = ""; | |
| 569 | + if ("手术产".equals(item.getTpmcfs()) || "手取胎盘".equals(item.getTpmcfs())) { | |
| 570 | + tpmcType = TpmcTypeEnums.O2.getId(); | |
| 571 | + } else if ("自然产出".equals(item.getTpmcfs()) || "自然娩出".equals(item.getTpmcfs())) { | |
| 572 | + tpmcType = TpmcTypeEnums.O.getId(); | |
| 573 | + } | |
| 574 | + extPlacenta.setTpmcType(tpmcType); | |
| 575 | + | |
| 576 | + extPlacentas.add(extPlacenta); | |
| 577 | + deliverAddRequest.setExtPlacentas(extPlacentas); | |
| 578 | + | |
| 579 | + MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); | |
| 580 | + Map<String,String> as = new HashMap<>(); | |
| 581 | + as.put("pf1",item1.getYfz()); | |
| 582 | + as.put("pf5",item1.getWfz()); | |
| 583 | + as.put("pf10", item1.getSfz()); | |
| 584 | + baby.setApgarScore(as); | |
| 585 | + baby.setBabyGender("男".equals(item1.getYexb()) ? "1" : "0"); | |
| 586 | + baby.setBabyHeight(item1.getSc());//新生儿生长 | |
| 587 | + baby.setBabyWeight(item1.getTz());//新生儿重量 | |
| 588 | + baby.setAsphyxiaM(item1.getZx()); //窒息分钟 | |
| 589 | + | |
| 590 | + baby.setDeformity("无".equals(item1.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 | |
| 591 | + | |
| 592 | + baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(item1.getCcqk())); // 妊娠结局 | |
| 593 | + baby.setDueTime(fmt1.format(dueDate1));//分娩时间 | |
| 594 | + babies.add(baby); | |
| 595 | + | |
| 596 | + } | |
| 597 | + deliverAddRequest.setBabies(babies); | |
| 598 | + deliverAddRequest.setFmHospital("216"); | |
| 599 | + ExceptionUtils.catchException("double deliverAddRequest===" + deliverAddRequest); | |
| 600 | + matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
| 601 | + deleteFmHistoryRecord(item.getSyxh()); | |
| 602 | + } | |
| 603 | + | |
| 604 | + } | |
| 605 | + else | |
| 606 | + { | |
| 607 | + List names = buildBabyName(items); | |
| 608 | + int count = 0; | |
| 609 | + for (FmItem i : items) | |
| 610 | + { | |
| 611 | + ExceptionUtils.catchException("items == "+items.size()); | |
| 612 | + String dueDateStr1 = i.getSsrq(); | |
| 613 | + if (!StringUtils.isNotEmpty(dueDateStr1)) | |
| 614 | + { | |
| 615 | + continue; | |
| 616 | + } | |
| 617 | + Date dueDate1 = null; | |
| 618 | + try{ | |
| 619 | + dueDate1 = fmt2.parse(dueDateStr); | |
| 620 | + }catch (Exception e) | |
| 621 | + { | |
| 622 | + dueDate1 = fmt.parse(dueDateStr); | |
| 623 | + } | |
| 624 | + | |
| 625 | + buildBaby( i,patInfo, dueDate1,patInfo.getName()+names.get(count).toString()); | |
| 626 | + count++; | |
| 627 | + } | |
| 628 | + | |
| 629 | + } | |
| 630 | + } | |
| 631 | + else | |
| 632 | + { | |
| 633 | + //没有找到孕妇建档的基本信息 记录下来 | |
| 634 | + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH:mm:ss"); | |
| 635 | + saveFmrecord(item.getSyxh(),format.parse(item.getJlrq())); | |
| 636 | + } | |
| 637 | + } | |
| 638 | + } | |
| 639 | + } | |
| 640 | + DbUtils.closeQuietly(conn); | |
| 641 | + } catch (SQLException e) { | |
| 642 | + ExceptionUtils.catchException(e, "sql执行异常"); | |
| 643 | + e.printStackTrace(); | |
| 644 | + } catch (ParseException e) { | |
| 645 | + ExceptionUtils.catchException(e, "分娩日期解析错误"); | |
| 646 | + e.printStackTrace(); | |
| 647 | + } catch (Exception e) | |
| 648 | + { | |
| 649 | + ExceptionUtils.catchException(e, "发生异常"); | |
| 650 | + e.printStackTrace(); | |
| 651 | + }finally { | |
| 652 | + DbUtils.closeQuietly(conn); | |
| 653 | + } | |
| 654 | + } | |
| 655 | + | |
| 656 | + private List buildBabyName(List<FmItem> items) { | |
| 657 | + String id = ""; | |
| 658 | + if (items.size() > 2) { | |
| 659 | + int boyCount = 0; | |
| 660 | + int girlCount = 0; | |
| 661 | + List<String> l = new ArrayList<>(); | |
| 662 | + for (int i = 0; i < items.size(); i++) { | |
| 663 | + FmItem item = items.get(i); | |
| 664 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(item.getYexb())) { | |
| 665 | + if ("男".equals(item.getYexb())) { | |
| 666 | + l.add(ONE_ENUMS.get(boyCount) + "子"); | |
| 667 | + boyCount++; | |
| 668 | + } else if ("女".equals(item.getYexb())) { | |
| 669 | + l.add(ONE_ENUMS.get(girlCount) + "女"); | |
| 670 | + girlCount++; | |
| 671 | + } | |
| 672 | + } | |
| 673 | + } | |
| 674 | + return l; | |
| 675 | + } else { | |
| 676 | + for (int i = 0; i < items.size(); i++) { | |
| 677 | + FmItem item = items.get(i); | |
| 678 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(item.getYexb())) { | |
| 679 | + if ("男".equals(item.getYexb())) | |
| 680 | + { | |
| 681 | + id += "1"; | |
| 682 | + } | |
| 683 | + else if ("女".equals(item.getYexb())) | |
| 684 | + { | |
| 685 | + id += "0"; | |
| 686 | + } | |
| 687 | + | |
| 688 | + } | |
| 689 | + } | |
| 690 | + return babyMap.get(id); | |
| 691 | + } | |
| 692 | + } | |
| 693 | + | |
| 694 | + private void saveFmrecord(String syxh,Date time) | |
| 695 | + { | |
| 696 | + FmRecordModel fmRecordModel = new FmRecordModel(); | |
| 697 | + fmRecordModel.setSyxh(syxh); | |
| 698 | + fmRecordModel.setTime(time); | |
| 699 | + babyBookbuildingFacade.saveFmrecord(fmRecordModel); | |
| 700 | + } | |
| 701 | + | |
| 702 | + public void buildBaby(FmItem item,FmPatInfo patInfo, Date dueDate, String babyName) | |
| 703 | + { | |
| 704 | + try{ | |
| 705 | + ExceptionUtils.catchException("buildBaby===="); | |
| 706 | + // O("活产", "0"),O1("死胎", "1"),O2("浸软胎", "2"),O3("死产", "3"); | |
| 707 | + if (!"活产".equals(item.getCcqk())) | |
| 708 | + { | |
| 709 | + return; | |
| 710 | + } | |
| 711 | + | |
| 712 | + UsersQuery usersQuery = new UsersQuery(); | |
| 713 | + usersQuery.setYn(YnEnums.YES.getId()); | |
| 714 | + usersQuery.setName("产房"); | |
| 715 | + usersQuery.setOrgId(216); | |
| 716 | + List<Users> users = usersService.queryUsers(usersQuery); | |
| 717 | + | |
| 718 | + BabyBookbuildingAddRequest request = new BabyBookbuildingAddRequest(); | |
| 719 | + request.setHospitalId("216"); | |
| 720 | + | |
| 721 | + request.setMommyName(patInfo.getName()); //母亲姓名 | |
| 722 | + | |
| 723 | + if (StringUtils.isNotEmpty(patInfo.getBirth())) | |
| 724 | + { | |
| 725 | + try { | |
| 726 | + SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); | |
| 727 | + Date birth = format.parse(patInfo.getBirth()); | |
| 728 | + format = new SimpleDateFormat("yyyy-MM-dd"); | |
| 729 | + request.setMommyBirthday(format.format(birth)); | |
| 730 | + }catch (ParseException e) | |
| 731 | + { | |
| 732 | + ExceptionUtils.catchException(e,"孕妇生日解析异常"); | |
| 733 | + } | |
| 734 | + | |
| 735 | + } | |
| 736 | + | |
| 737 | + | |
| 738 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(patInfo.getCardNo())) | |
| 739 | + { | |
| 740 | + request.setMommyCertificateTypeId("70ae1d93-2964-46bc-83fa-bec9ff605b1c"); //证件类型 (身份证号码) | |
| 741 | + request.setMommyCertificateNum(patInfo.getCardNo()); //证件号 | |
| 742 | + } | |
| 743 | + else if (StringUtils.isNotEmpty(patInfo.getPhone())) | |
| 744 | + { | |
| 745 | + request.setMommyCertificateTypeId("57e1dcd3f0f02e7ca519d6c6"); //证件类型 (手机号码) | |
| 746 | + request.setMommyCertificateNum(patInfo.getPhone()); //证件号 | |
| 747 | + } | |
| 748 | + | |
| 749 | + request.setMommyPhone(patInfo.getPhone()); | |
| 750 | + | |
| 751 | + request.setBabyName(babyName); | |
| 752 | + request.setSex("男".equals(item.getYexb()) ? 1 : 0); | |
| 753 | + | |
| 754 | + request.setBabyBirthday(DateUtil.getyyyy_MM_dd(dueDate)); //生日 | |
| 755 | + | |
| 756 | + if (StringUtils.isNotEmpty(item.getRc())) { | |
| 757 | + String week = ""; | |
| 758 | + if (item.getRc().split("\\u002B").length > 1) { | |
| 759 | + week = item.getRc().split("\\u002B")[0]; | |
| 760 | + } else { | |
| 761 | + week = item.getRc(); | |
| 762 | + } | |
| 763 | + try { | |
| 764 | + request.setDueWeek(Integer.parseInt(week)); //分娩孕周 | |
| 765 | + }catch (Exception e) | |
| 766 | + { | |
| 767 | + | |
| 768 | + } | |
| 769 | + } | |
| 770 | + | |
| 771 | + String fmfs = ""; | |
| 772 | + if (item.getFmfs() != null && "剖宫产".equals(item.getFmfs())) | |
| 773 | + { | |
| 774 | + fmfs = FmTypeEnums.O1.getId(); | |
| 775 | + } | |
| 776 | + else | |
| 777 | + { | |
| 778 | + fmfs = FmTypeEnums.O.getId(); | |
| 779 | + } | |
| 780 | + | |
| 781 | + request.setDueType(fmfs);//分娩方式 | |
| 782 | + request.setFetusCount(item.getDjt()); //第几胎 | |
| 783 | + request.setDueCount(item.getCjc());//第几产 | |
| 784 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 785 | + double w = Double.parseDouble(item.getTz()); | |
| 786 | + request.setBabyWeight(df.format(w/1000)); //体重 | |
| 787 | + request.setBabyHeight(item.getSc()); //身长 | |
| 788 | + Map<String,String> map = new HashMap<>(); | |
| 789 | + map.put("pf1",item.getYfz()); | |
| 790 | + map.put("pf5", item.getWfz()); | |
| 791 | + map.put("pf10", item.getSfz()); | |
| 792 | + request.setApgarScore(map); | |
| 793 | + request.setDeliverOrg("216"); | |
| 794 | + | |
| 795 | + request.setBuildDoctor(users.get(0).getId() + ""); | |
| 796 | + request.setBuildDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
| 797 | + request.setHighRisk("是".equals(item.getSfgw()) ? 1 : 0); ////是否高危 0 非高危 1高危 | |
| 798 | + request.setMalformation("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 | |
| 799 | + | |
| 800 | + request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务 | |
| 801 | + request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通 | |
| 802 | + | |
| 803 | + if (patInfo != null && StringUtils.isNotEmpty(patInfo.getBlh())) | |
| 804 | + { | |
| 805 | + Map<String,Object> diags = qhdfyHisService.queryHisBabyDiagnosis(patInfo.getBlh()); | |
| 806 | + if (diags != null && diags.size() > 0) | |
| 807 | + { | |
| 808 | + request.setBlNo(patInfo.getBlh()); | |
| 809 | + request.setBabyDiagnosis(diags.get("diagnosisItem") == null ? "" : diags.get("diagnosisItem").toString()); | |
| 810 | + } | |
| 811 | + } | |
| 812 | + babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId()); | |
| 813 | + deleteFmHistoryRecord(item.getSyxh()); | |
| 814 | + }catch (Exception e) | |
| 815 | + { | |
| 816 | + ExceptionUtils.catchException(e, "buildBaby exception"); | |
| 817 | + e.printStackTrace(); | |
| 818 | + } | |
| 819 | + | |
| 820 | + | |
| 821 | + } | |
| 822 | + | |
| 823 | + /** | |
| 824 | + *查询通过分娩的syxh来查询对应孕妇的基本信息 | |
| 825 | + * @param syxh | |
| 826 | + * @return | |
| 827 | + */ | |
| 828 | + public FmPatInfo getFmPatInfoById(String syxh) | |
| 829 | + { | |
| 830 | + Connection conn = ConnTools.makeFmConnection(); | |
| 831 | + QueryRunner queryRunner = new QueryRunner(); | |
| 832 | + try { | |
| 833 | + FmPatInfo patInfo = null; | |
| 834 | + | |
| 835 | + List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone, blh FROM THIS4_BASY WHERE lxrdh <> '' and hzxm is not null and hzxm <> '' and len(lxrdh) = 11 and syxh = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class)); | |
| 836 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 837 | + patInfo = list.get(0); | |
| 838 | + } | |
| 839 | + else | |
| 840 | + { | |
| 841 | + List<FmPatInfo> list1 = queryRunner.query(conn, "SELECT SYXH as syxh, BRXM as name,'' as cardNo,BRXB as sex,'' as birth,LXDH as phone,ZYHM as blh FROM JHMK_BASY WHERE len(LXDH) = 11 and SYXH = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class)); | |
| 842 | + if (CollectionUtils.isNotEmpty(list1)) { | |
| 843 | + patInfo = list1.get(0); | |
| 844 | + } | |
| 845 | + } | |
| 846 | + DbUtils.closeQuietly(conn); | |
| 847 | + return patInfo; | |
| 848 | + | |
| 849 | + } catch (SQLException e) { | |
| 850 | + DbUtils.closeQuietly(conn); | |
| 851 | + e.printStackTrace(); | |
| 852 | + } | |
| 853 | + return null; | |
| 854 | + } | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyHisService.java
View file @
d2bcf36
| 1 | +package com.lyms.hospitalapi.dzfy; | |
| 2 | + | |
| 3 | +import com.lyms.hospitalapi.pojo.*; | |
| 4 | +import com.lyms.platform.common.utils.DateUtil; | |
| 5 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 6 | +import com.lyms.platform.pojo.LisReport; | |
| 7 | +import com.lyms.platform.pojo.LisReportItem; | |
| 8 | +import org.apache.commons.collections.CollectionUtils; | |
| 9 | +import org.apache.commons.dbutils.DbUtils; | |
| 10 | +import org.apache.commons.dbutils.QueryRunner; | |
| 11 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
| 12 | +import org.apache.commons.lang.StringUtils; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | + | |
| 15 | +import java.sql.Connection; | |
| 16 | +import java.sql.SQLException; | |
| 17 | +import java.text.SimpleDateFormat; | |
| 18 | +import java.util.*; | |
| 19 | + | |
| 20 | +/** | |
| 21 | + * Created by Administrator on 2017/4/12. | |
| 22 | + */ | |
| 23 | +@Service("dzfyHisService") | |
| 24 | +public class DzfyHisService { | |
| 25 | + | |
| 26 | + public List<CheckByDate> queryCheckListupdate(String cardNo,int ftype){ | |
| 27 | + | |
| 28 | + if(1==ftype){ | |
| 29 | + List<CheckResponse> result = new ArrayList<>(); | |
| 30 | + | |
| 31 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 32 | + //List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 33 | + //result.addAll(l); | |
| 34 | + result.addAll(queryLisCheckList(cardNo)); | |
| 35 | + //result.addAll(queryPacsCheckList(cardNo)); | |
| 36 | + List<String> keyList = new ArrayList<>(); | |
| 37 | + // 去重 | |
| 38 | + List<CheckResponse> list = new ArrayList<>(); | |
| 39 | + Date tempDate = null; | |
| 40 | + for (CheckResponse check:result) { | |
| 41 | + if (check.getModified() != null && check.getModified().equals(tempDate)) { | |
| 42 | + continue; | |
| 43 | + } | |
| 44 | + list.add(check); | |
| 45 | + tempDate = check.getModified(); | |
| 46 | + } | |
| 47 | + // 排序 | |
| 48 | + Collections.sort(list, new Comparator() { | |
| 49 | + public int compare(Object a, Object b) { | |
| 50 | + if (((CheckResponse)a).getModified() == null) { | |
| 51 | + return -1; | |
| 52 | + } | |
| 53 | + if (((CheckResponse)b).getModified() == null) { | |
| 54 | + return -1; | |
| 55 | + } | |
| 56 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 57 | + return 1; | |
| 58 | + } | |
| 59 | + return -1; | |
| 60 | + } | |
| 61 | + }); | |
| 62 | + | |
| 63 | + for (CheckResponse check:list) { | |
| 64 | + String ymd = DateUtil.getyyyy_MM_dd(check.getModified()); | |
| 65 | + if (!keyList.contains(ymd)) { | |
| 66 | + keyList.add(ymd); | |
| 67 | + } | |
| 68 | + | |
| 69 | + } | |
| 70 | + | |
| 71 | + for(String time:keyList){ | |
| 72 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 73 | + List<CheckResponse> result2=new ArrayList<>();//存放所有检验报告(type=1) | |
| 74 | + List<CheckResponse> result3=new ArrayList<>();//存放所有影像报告(type=2) | |
| 75 | + List<CheckResponse> result4=new ArrayList<>();//存放所有其他报告 | |
| 76 | + CheckType jianyan=new CheckType(); | |
| 77 | + jianyan.setType("检验报告"); | |
| 78 | + CheckType yingxiang=new CheckType(); | |
| 79 | + yingxiang.setType("影像报告"); | |
| 80 | + CheckType other=new CheckType(); | |
| 81 | + other.setType("其它报告"); | |
| 82 | + for(CheckResponse chre:result){ | |
| 83 | + if(time.equals(DateUtil.getyyyy_MM_dd(chre.getModified()))){ | |
| 84 | + if(chre.getType() == 1){ | |
| 85 | + result2.add(chre); | |
| 86 | + //jianyan.setTypeName(result2); | |
| 87 | + //CheckType.add(jianyan); | |
| 88 | + }else if(chre.getType() == 2){ | |
| 89 | + result3.add(chre); | |
| 90 | + //yingxiang.setTypeName(result3); | |
| 91 | + //CheckType.add(yingxiang); | |
| 92 | + }else{ | |
| 93 | + result4.add(chre); | |
| 94 | + //other.setTypeName(result4); | |
| 95 | + //CheckType.add(other); | |
| 96 | + } | |
| 97 | + | |
| 98 | + } | |
| 99 | + } | |
| 100 | + | |
| 101 | + jianyan.setTypeName(result2); | |
| 102 | + CheckType.add(jianyan); | |
| 103 | + | |
| 104 | + yingxiang.setTypeName(result3); | |
| 105 | + CheckType.add(yingxiang); | |
| 106 | + | |
| 107 | + other.setTypeName(result4); | |
| 108 | + CheckType.add(other); | |
| 109 | + | |
| 110 | + | |
| 111 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 112 | + CheckByDate1.setTime(time); | |
| 113 | + CheckByDate1.setTypes(CheckType); | |
| 114 | + CheckByDate.add(CheckByDate1); | |
| 115 | + } | |
| 116 | + | |
| 117 | + return CheckByDate; | |
| 118 | + | |
| 119 | + }else{ | |
| 120 | + List<CheckResponse> result = new ArrayList<CheckResponse>(); | |
| 121 | + List<CheckByDate> CheckByDate=new ArrayList<CheckByDate>(); | |
| 122 | + //List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 123 | + //result.addAll(l); | |
| 124 | + result.addAll(queryLisCheckList(cardNo)); | |
| 125 | + //result.addAll(queryPacsCheckList(cardNo)); | |
| 126 | + List<String> keyList = new ArrayList<>(); | |
| 127 | + List<String> listtype=new ArrayList<>(); | |
| 128 | + List<CheckResponse> listt = new ArrayList<>(); | |
| 129 | + // 去重 | |
| 130 | + List<CheckResponse> list = new ArrayList<>(); | |
| 131 | + Integer num=0; | |
| 132 | + for(CheckResponse check:result){ | |
| 133 | + if(check.getType()!=null && check.getType()==num){ | |
| 134 | + continue; | |
| 135 | + } | |
| 136 | + list.add(check); | |
| 137 | + num=check.getType(); | |
| 138 | + } | |
| 139 | + String t=null; | |
| 140 | + for(CheckResponse check:result){ | |
| 141 | + if(check.getTitle()!=null && check.getTitle().equals(t)){ | |
| 142 | + continue; | |
| 143 | + } | |
| 144 | + listt.add(check); | |
| 145 | + t=check.getTitle(); | |
| 146 | + } | |
| 147 | + | |
| 148 | + | |
| 149 | + // 排序 | |
| 150 | + Collections.sort(list, new Comparator() { | |
| 151 | + public int compare(Object a, Object b) { | |
| 152 | + if (((CheckResponse)a).getModified() == null) { | |
| 153 | + return -1; | |
| 154 | + } | |
| 155 | + if (((CheckResponse)b).getModified() == null) { | |
| 156 | + return -1; | |
| 157 | + } | |
| 158 | + if (((CheckResponse)a).getModified().before(((CheckResponse)a).getModified())) { | |
| 159 | + return 1; | |
| 160 | + } | |
| 161 | + return -1; | |
| 162 | + } | |
| 163 | + }); | |
| 164 | + | |
| 165 | + for (CheckResponse check:list) { | |
| 166 | + Integer ymd = check.getType(); | |
| 167 | + if (!keyList.contains(ymd.toString())) { | |
| 168 | + keyList.add(ymd.toString()); | |
| 169 | + } | |
| 170 | + | |
| 171 | + } | |
| 172 | + for(CheckResponse check:listt){ | |
| 173 | + String ty=check.getTitle(); | |
| 174 | + if(!listtype.contains(ty)){ | |
| 175 | + listtype.add(ty); | |
| 176 | + } | |
| 177 | + } | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + for(String type:keyList){ | |
| 183 | + | |
| 184 | + List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 185 | + | |
| 186 | + for(String typ:listtype){ | |
| 187 | + List<CheckResponse> result2=new ArrayList<>(); | |
| 188 | + CheckType CheckType1=new CheckType(); | |
| 189 | + //CheckType1.setType(typ); | |
| 190 | + for(CheckResponse chre:result){ | |
| 191 | + if(type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())){ | |
| 192 | + chre.setTitle(DateUtil.getyyyy_MM_dd(chre.getModified())+" "+chre.getTitle()); | |
| 193 | + result2.add(chre); | |
| 194 | + //CheckType1.setTypeName(result2); | |
| 195 | + //CheckType.add(CheckType1); | |
| 196 | + } | |
| 197 | + | |
| 198 | + } | |
| 199 | + if(result2.size()>0){ | |
| 200 | + CheckType1.setType(typ); | |
| 201 | + CheckType1.setTypeName(result2); | |
| 202 | + CheckType.add(CheckType1); | |
| 203 | + } | |
| 204 | + | |
| 205 | + } | |
| 206 | + | |
| 207 | + | |
| 208 | + CheckByDate CheckByDate1=new CheckByDate(); | |
| 209 | + if("1".equals(type)){ | |
| 210 | + CheckByDate1.setTime("检验报告"); | |
| 211 | + CheckByDate1.setTypes(CheckType); | |
| 212 | + CheckByDate.add(CheckByDate1); | |
| 213 | + }else if("2".equals(type)){ | |
| 214 | + CheckByDate1.setTime("影像报告"); | |
| 215 | + CheckByDate1.setTypes(CheckType); | |
| 216 | + CheckByDate.add(CheckByDate1); | |
| 217 | + }else{ | |
| 218 | + CheckByDate1.setTime("其它报告"); | |
| 219 | + CheckByDate1.setTypes(CheckType); | |
| 220 | + CheckByDate.add(CheckByDate1); | |
| 221 | + } | |
| 222 | + | |
| 223 | + } | |
| 224 | + | |
| 225 | + return CheckByDate; | |
| 226 | + } | |
| 227 | + | |
| 228 | + | |
| 229 | + } | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + public List<CheckResponse> queryLisCheckList(String cardNo) { | |
| 235 | + List<CheckResponse> result = new ArrayList<>(); | |
| 236 | + if (StringUtils.isNotBlank(cardNo)) { | |
| 237 | + Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection(); | |
| 238 | + QueryRunner queryRunner = new QueryRunner(true); | |
| 239 | + try { | |
| 240 | + String sql = "select TYPE as classifyName,NAME as name,LIS_ID as hospitalId,BHNUM as patientHid,VCCARDNO as vcCardNo,SEX as sex,to_number(replace(AGE,'岁') ) as age,APPLY_DEPT as deptName,APPLY_DOCTOR as applyDoctorName,CHECKER as checkDoctorName,PUBLISH_TIME as publishTime from zlhis.lis_report_info where VCCARDNO ='"+cardNo+"' order by LIS_ID desc"; | |
| 241 | + String subSql = "select LIS_ID as id,CODE as code,NAME as name,RESULT as result,RESULT_FLAG as flag,REF as ref,UNIT as unit,RESULT_TYPE as resultType from zlhis.lis_report_item where LIS_ID='"; | |
| 242 | + List<LisReport> lisReportList = queryRunner.query(conn, sql, new BeanListHandler<LisReport>(LisReport.class)); | |
| 243 | + List<LisCheckInfo> list = new ArrayList<>(); | |
| 244 | + if (lisReportList.size() > 0) { | |
| 245 | + for (LisReport lisReport:lisReportList) { | |
| 246 | + // hospitalId为申请号 | |
| 247 | + if (StringUtils.isNotBlank(lisReport.getHospitalId())) { | |
| 248 | + List<LisReportItem> lisReportItemList = queryRunner.query(conn, subSql+lisReport.getHospitalId()+"'", new BeanListHandler<LisReportItem>(LisReportItem.class)); | |
| 249 | + if (lisReportItemList != null && lisReportItemList.size() > 0) { | |
| 250 | + CheckResponse check = new CheckResponse(); | |
| 251 | + check.setModified(lisReport.getPublishTime()); | |
| 252 | + check.setType(1); | |
| 253 | + check.setName(lisReport.getName()); | |
| 254 | + check.setTitle(lisReport.getClassifyName()); | |
| 255 | + check.setHospitalName("德州妇幼保健院");//新增医院名称字段赋值 | |
| 256 | + if (lisReport.getAge() != null) { | |
| 257 | + check.setAge(lisReport.getAge().toString()); | |
| 258 | + } | |
| 259 | + check.setApplyDate(lisReport.getPublishTime()); | |
| 260 | + check.setApplyDateStr(DateUtil.getyyyy_MM_dd(lisReport.getPublishTime())); | |
| 261 | + check.setCheckDept(lisReport.getDeptName()); | |
| 262 | + check.setDoctor(lisReport.getApplyDoctorName()); | |
| 263 | + check.setSex(lisReport.getSex()); | |
| 264 | + List<CheckItemResponse> itemList = new ArrayList<>(); | |
| 265 | + check.setItemList(itemList); | |
| 266 | + for (LisReportItem checkItem:lisReportItemList) { | |
| 267 | + CheckItemResponse item = new CheckItemResponse(); | |
| 268 | + item.setName(checkItem.getName()); | |
| 269 | + item.setCode(checkItem.getCode()); | |
| 270 | + item.setRefer(checkItem.getRef()); | |
| 271 | + if (StringUtils.isNotBlank(checkItem.getNumberResult())) { | |
| 272 | + item.setResult(checkItem.getNumberResult()); | |
| 273 | + } else if (StringUtils.isNotBlank(checkItem.getCharResult())) { | |
| 274 | + item.setResult(checkItem.getCharResult()); | |
| 275 | + } else { | |
| 276 | + item.setResult(checkItem.getResult()); | |
| 277 | + } | |
| 278 | + item.setUnit(checkItem.getUnit()); | |
| 279 | + item.setSpecial(checkItem.getFlag()); | |
| 280 | + itemList.add(item); | |
| 281 | + } | |
| 282 | + result.add(check); | |
| 283 | + } | |
| 284 | + } | |
| 285 | + | |
| 286 | + } | |
| 287 | + } | |
| 288 | + DbUtils.closeQuietly(conn); | |
| 289 | + return result; | |
| 290 | + } catch (SQLException e) { | |
| 291 | + DbUtils.closeQuietly(conn); | |
| 292 | + e.printStackTrace(); | |
| 293 | + return result; | |
| 294 | + } | |
| 295 | + } | |
| 296 | + return result; | |
| 297 | + } | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + public static Date parseYmd(String s) { | |
| 305 | + SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd"); | |
| 306 | + if (s == null) { | |
| 307 | + return null; | |
| 308 | + } | |
| 309 | + try { | |
| 310 | + return ymd.parse(s); | |
| 311 | + } catch (Exception e) { | |
| 312 | + return null; | |
| 313 | + } | |
| 314 | + } | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + public List<Map<String,Object>> getPatientInfoList(String cardNo){ | |
| 320 | + List<Map<String,Object>> result = new ArrayList<>(); | |
| 321 | + | |
| 322 | + if (StringUtils.isNotBlank(cardNo)) { | |
| 323 | + | |
| 324 | + long start = System.currentTimeMillis(); | |
| 325 | + | |
| 326 | + Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection(); | |
| 327 | + QueryRunner queryRunner = new QueryRunner(); | |
| 328 | + | |
| 329 | + long end = System.currentTimeMillis(); | |
| 330 | + | |
| 331 | + System.out.println("times3 = " + (end - start)); | |
| 332 | + | |
| 333 | + try{ | |
| 334 | + | |
| 335 | + List<PregPatientinfo> list = queryRunner.query(conn, "select * from (select id as P_ID,name as P_NAME, sex as P_SEX, idcade as P_CARDNO, birthday as BIRTH, bhnum as P_BHNUM, phone as P_MOBILEPHONE from zlhis.v_patientinfo where cardno= '"+cardNo+"') where rownum=1", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class)); | |
| 336 | + if (list.size() > 0) { | |
| 337 | + for (PregPatientinfo info:list) { | |
| 338 | + Map<String,Object> map = new HashMap<>(); | |
| 339 | + map.put("bhnum", info.getP_BHNUM()); | |
| 340 | + if ("男".equals(info.getP_SEX())) { | |
| 341 | + map.put("sex", "男"); | |
| 342 | + } else if ("女".equals(info.getP_SEX())) { | |
| 343 | + map.put("sex", "女"); | |
| 344 | + } | |
| 345 | + map.put("name", info.getP_NAME()); | |
| 346 | + map.put("idCardNo", info.getP_CARDNO()); //身份证号码 | |
| 347 | + map.put("cardNo", cardNo);//就诊卡号 | |
| 348 | + map.put("phone", info.getP_MOBILEPHONE()); | |
| 349 | + map.put("birth", DateUtil.getyyyy_MM_dd(parseYmd(info.getBIRTH()))); | |
| 350 | + result.add(map); | |
| 351 | + } | |
| 352 | + | |
| 353 | + } | |
| 354 | + | |
| 355 | + long end1 = System.currentTimeMillis(); | |
| 356 | + System.out.println("times4 = " + (end1 - end)); | |
| 357 | + DbUtils.closeQuietly(conn); | |
| 358 | + | |
| 359 | + }catch (SQLException e){ | |
| 360 | + | |
| 361 | + DbUtils.closeQuietly(conn); | |
| 362 | + ExceptionUtils.catchException(e, "dz his exception "); | |
| 363 | + e.printStackTrace(); | |
| 364 | + } | |
| 365 | + | |
| 366 | + } | |
| 367 | + | |
| 368 | + | |
| 369 | + return result; | |
| 370 | + } | |
| 371 | + | |
| 372 | + /** | |
| 373 | + * 查询儿童出院诊断信息(his) | |
| 374 | + * @param blNo | |
| 375 | + * @return | |
| 376 | + */ | |
| 377 | + | |
| 378 | + public Map<String,Object> queryHisBabyDiagnosis(String blNo) { | |
| 379 | + | |
| 380 | + Map<String,Object> map = new HashMap<>(); | |
| 381 | + StringBuffer sb = new StringBuffer(); | |
| 382 | + if (StringUtils.isNotBlank(blNo)) { | |
| 383 | + Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection(); | |
| 384 | + QueryRunner queryRunner = new QueryRunner(); | |
| 385 | + | |
| 386 | + try { | |
| 387 | + // List<DiagnosisInfo> list = queryRunner.query(conn, "select cyzdmc as diagnosisItem from ZY_BRSYK where blh= '"+blNo+"'", new BeanListHandler<DiagnosisInfo>(DiagnosisInfo.class)); | |
| 388 | + List<DiagnosisInfo> list = queryRunner.query(conn, "select DIAGNOSE as diagnosisItem from zlhis.v_kids_hdiagnose where BHNUM = '"+blNo+"'", new BeanListHandler<DiagnosisInfo>(DiagnosisInfo.class)); | |
| 389 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 390 | +// for (DiagnosisInfo info:list) { | |
| 391 | +// map.put("diagnosisItem", info.getDiagnosisItem()); | |
| 392 | +// break; | |
| 393 | +// } | |
| 394 | + | |
| 395 | + for (int i = 0 ; i < list.size() ; i++) | |
| 396 | + { | |
| 397 | + if (i < list.size() -1) | |
| 398 | + { | |
| 399 | + sb.append(list.get(i).getDiagnosisItem()); | |
| 400 | + sb.append(", "); | |
| 401 | + } | |
| 402 | + else | |
| 403 | + { | |
| 404 | + sb.append(list.get(i).getDiagnosisItem()); | |
| 405 | + } | |
| 406 | + } | |
| 407 | + } | |
| 408 | + DbUtils.closeQuietly(conn); | |
| 409 | + } catch (SQLException e) { | |
| 410 | + DbUtils.closeQuietly(conn); | |
| 411 | + e.printStackTrace(); | |
| 412 | + } | |
| 413 | + } | |
| 414 | + map.put("diagnosisItem", sb.toString()); | |
| 415 | + return map; | |
| 416 | + } | |
| 417 | + | |
| 418 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
View file @
d2bcf36
| ... | ... | @@ -626,7 +626,7 @@ |
| 626 | 626 | } else if (StringUtils.isNotBlank(checkItem.getCharResult())) { |
| 627 | 627 | item.setResult(checkItem.getCharResult()); |
| 628 | 628 | } else { |
| 629 | - item.setResult(item.getResult()); | |
| 629 | + item.setResult(checkItem.getResult()); | |
| 630 | 630 | } |
| 631 | 631 | item.setUnit(checkItem.getUnit()); |
| 632 | 632 | item.setSpecial(checkItem.getFlag()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
d2bcf36
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | +import com.lyms.hospitalapi.dzfy.DzfyHisService; | |
| 3 | 4 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
| 4 | 5 | import com.lyms.hospitalapi.v1.HisService; |
| 5 | 6 | import com.lyms.platform.biz.service.PatientCheckTicketService; |
| ... | ... | @@ -43,6 +44,9 @@ |
| 43 | 44 | @Autowired |
| 44 | 45 | private QhdfyHisService qhdfyHisService; |
| 45 | 46 | @Autowired |
| 47 | + private DzfyHisService dzfyHisService; | |
| 48 | + | |
| 49 | + @Autowired | |
| 46 | 50 | private AntExRecordFacade antExRecordFacade; |
| 47 | 51 | @Autowired |
| 48 | 52 | private PatientCheckTicketService checkTicketService; |
| ... | ... | @@ -90,7 +94,9 @@ |
| 90 | 94 | } else if ("3".equals(HIS_VERSION)) { |
| 91 | 95 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); |
| 92 | 96 | } else if ("4".equals(HIS_VERSION)) { |
| 93 | - return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(qhdfyHisService.queryCheckListupdate(cardNo,ftype)); | |
| 97 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(qhdfyHisService.queryCheckListupdate(cardNo, ftype)); | |
| 98 | + } else if ("6".equals(HIS_VERSION)) { | |
| 99 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(dzfyHisService.queryCheckListupdate(cardNo, ftype)); | |
| 94 | 100 | } else { |
| 95 | 101 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); |
| 96 | 102 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
d2bcf36
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.fnfy.FnfyHisService; |
| 4 | 4 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
| 5 | +import com.lyms.hospitalapi.dzfy.DzfyHisService; | |
| 5 | 6 | import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; |
| 6 | 7 | import com.lyms.hospitalapi.v2.HisService; |
| 7 | 8 | import com.lyms.platform.biz.service.*; |
| ... | ... | @@ -64,6 +65,9 @@ |
| 64 | 65 | private QhdfyHisService qhdfyHisService; |
| 65 | 66 | |
| 66 | 67 | @Autowired |
| 68 | + private DzfyHisService dzfyHisService; | |
| 69 | + | |
| 70 | + @Autowired | |
| 67 | 71 | private BabyBookbuildingService babyBookbuildingService; |
| 68 | 72 | |
| 69 | 73 | @Autowired |
| ... | ... | @@ -1319,7 +1323,7 @@ |
| 1319 | 1323 | } |
| 1320 | 1324 | |
| 1321 | 1325 | puerperaQuery.setPhoneOrCert(param.getCardNo()); |
| 1322 | - } else if (param.getHospitalId() != null & !StringUtils.isEmpty(param.getVcCardNo())) { | |
| 1326 | + } else if (param.getHospitalId()!= null & !StringUtils.isEmpty(param.getVcCardNo())) { | |
| 1323 | 1327 | |
| 1324 | 1328 | long start = System.currentTimeMillis(); |
| 1325 | 1329 | BabyModelQuery babyQuery = new BabyModelQuery(); |
| ... | ... | @@ -1409,6 +1413,8 @@ |
| 1409 | 1413 | map.put("hisPatient", fnfyHisService.getPatientInfoList(param.getVcCardNo())); |
| 1410 | 1414 | }else if ("4".equals(HIS_VERSION)) { |
| 1411 | 1415 | map.put("hisPatient", qhdfyHisService.getPatientInfoList(param.getVcCardNo())); |
| 1416 | + }else if ("6".equals(HIS_VERSION)) { | |
| 1417 | + map.put("hisPatient", dzfyHisService.getPatientInfoList(param.getVcCardNo())); | |
| 1412 | 1418 | } |
| 1413 | 1419 | } |
| 1414 | 1420 | } |
| 1415 | 1421 | |
| ... | ... | @@ -2306,11 +2312,19 @@ |
| 2306 | 2312 | } |
| 2307 | 2313 | |
| 2308 | 2314 | public BaseResponse queryHisBabyDiagnosis(String blNo) { |
| 2309 | - Map<String,Object> results = qhdfyHisService.queryHisBabyDiagnosis(blNo); | |
| 2310 | 2315 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
| 2311 | - objectResponse.setData(results); | |
| 2312 | - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2313 | - objectResponse.setErrormsg("成功"); | |
| 2316 | + if("4".equals(HIS_VERSION)){ | |
| 2317 | + Map<String,Object> results = qhdfyHisService.queryHisBabyDiagnosis(blNo); | |
| 2318 | + objectResponse.setData(results); | |
| 2319 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2320 | + objectResponse.setErrormsg("成功"); | |
| 2321 | + }else if("6".equals(HIS_VERSION)){ | |
| 2322 | + Map<String,Object> results = dzfyHisService.queryHisBabyDiagnosis(blNo); | |
| 2323 | + objectResponse.setData(results); | |
| 2324 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2325 | + objectResponse.setErrormsg("成功"); | |
| 2326 | + } | |
| 2327 | + | |
| 2314 | 2328 | return objectResponse; |
| 2315 | 2329 | } |
| 2316 | 2330 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
d2bcf36
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.fnfy.FnfyHisService; |
| 4 | 4 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
| 5 | +import com.lyms.hospitalapi.dzfy.DzfyHisService; | |
| 5 | 6 | import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; |
| 6 | 7 | import com.lyms.hospitalapi.v2.HisService; |
| 7 | 8 | import com.lyms.platform.biz.service.*; |
| 8 | 9 | |
| ... | ... | @@ -95,7 +96,10 @@ |
| 95 | 96 | @Autowired |
| 96 | 97 | private QhdfyHisService qhdfyHisService; |
| 97 | 98 | |
| 99 | + @Autowired | |
| 100 | + private DzfyHisService dzfyHisService; | |
| 98 | 101 | |
| 102 | + | |
| 99 | 103 | @Autowired |
| 100 | 104 | private DeleteProcessHandler deleteProcessHandler; |
| 101 | 105 | |
| ... | ... | @@ -604,6 +608,8 @@ |
| 604 | 608 | typeMap.put("hisPatient", fnfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); |
| 605 | 609 | } else if ("4".equals(HIS_VERSION)) { |
| 606 | 610 | typeMap.put("hisPatient", qhdfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); |
| 611 | + }else if ("6".equals(HIS_VERSION)){ | |
| 612 | + typeMap.put("hisPatient", dzfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); | |
| 607 | 613 | } |
| 608 | 614 | } |
| 609 | 615 | } |
platform-operate-api/src/main/resources/config.properties
View file @
d2bcf36