Commit dce34e6fc4629a42d1a7b42bb9bf055d627e80c4

Authored by gengxiaokai
1 parent 41b77c51b3

承德公共卫生接口

Showing 1 changed file with 85 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfFmService.java View file @ dce34e6
  1 +package com.lyms.hospitalapi.lcdcf;
  2 +
  3 +import com.lyms.hospitalapi.dzfy.Fm;
  4 +import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
  5 +import com.lyms.platform.operate.web.result.MaternalDeliverResult;
  6 +import org.apache.commons.dbutils.QueryRunner;
  7 +import org.apache.commons.dbutils.handlers.BeanListHandler;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import java.sql.Connection;
  11 +import java.text.SimpleDateFormat;
  12 +import java.util.ArrayList;
  13 +import java.util.List;
  14 +
  15 +/**
  16 + * Created by Administrator on 2018/4/20.
  17 + * 通过住院号获取孕妇分娩信息
  18 + */
  19 +@Service("LcdcfFmService")
  20 +public class LcdcfFmService {
  21 +
  22 + public MaternalDeliverResult queryFmPatient(String bhnum){
  23 +
  24 + String cloumns = " ID as ID,\n" +
  25 + " BHNUM as BHNUM,\n" +
  26 + " VCCARDNO as VCCARDNO,\n" +
  27 + " PHONE as PHONE,\n" +
  28 + " NAME as NAME,\n" +
  29 + " IDCARD as IDCARD,\n" +
  30 + " CREATED as CREATED,\t\n" +
  31 + " to_char(BABY_DELIVERY_TIME,'yyyy-mm-dd hh24:mi:ss') as BABY_DELIVERY_TIME,\n" +
  32 + " BABY_SEX as BABY_SEX,\n" +
  33 + " DUE_WEEK as DUE_WEEK,\n" +
  34 + " DUE_DAY as DUE_DAY,\n" +
  35 + " FETUS_NUM as FETUS_NUM,\n" +
  36 + " BABY_ASPHYXIAM as BABY_ASPHYXIAM,\n" +
  37 + " BABY_WEIGHT as BABY_WEIGHT,\n" +
  38 + " BABY_HEIGHT as BABY_HEIGHT,\n" +
  39 + " BABY_APGAR_SCORE_ONE as BABY_APGAR_SCORE_ONE,\n" +
  40 + " BABY_APGAR_SCORE_FIVE as BABY_APGAR_SCORE_FIVE,\n" +
  41 + " BABY_APGAR_SCORE_TEN as BABY_APGAR_SCORE_TEN,\n" +
  42 + " BABY_PREGNANCY_OUT as BABY_PREGNANCY_OUT,\n" +
  43 + " TMCSIDE as TMCSIDE,\n" +
  44 + " TMCTYPE as TMCTYPE,\n" +
  45 + " MATERNAL_INFO as MATERNAL_INFO,\n" +
  46 + " PERINEAL_CONDITION as PERINEAL_CONDITION,\n" +
  47 + " SH_LOSE_BLOOD as SH_LOSE_BLOOD,\n" +
  48 + " TH_LOSE_BLOOD as TH_LOSE_BLOOD,\n" +
  49 + " DELIVER_DOCTOR as DELIVER_DOCTOR,\n" +
  50 + " PROD_PROCESS_ONE as PROD_PROCESS_ONE,\n" +
  51 + " PROD_PROCESS_TWO as PROD_PROCESS_TWO,\n" +
  52 + " PROD_PROCESS_THREE as PROD_PROCESS_THREE,\n" +
  53 + " TOTAL_PROCESS as TOTAL_PROCESS,\n" +
  54 + " PLACENTA_NUM as PLACENTA_NUM,\n" +
  55 + " DELIVER_HOSPITAL as DELIVER_HOSPITAL,\n" +
  56 + " DELIVER_DOCTOR as DELIVER_DOCTOR";
  57 +
  58 + Connection conn = com.lyms.hospitalapi.lcdcf.ConnTools.makeHisConnection();
  59 + QueryRunner queryRunner = new QueryRunner();
  60 + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  61 + try {
  62 +
  63 + String sql = "select "+cloumns+" from v_deliveryinfo where BHNUM="+bhnum+"and BABY_PREGNANCY_OUT='活胎'";
  64 + List<Fm> list = queryRunner.query(conn, sql, new BeanListHandler<Fm>(Fm.class));
  65 + if(list!=null && list.size()>0){
  66 +
  67 + List<MaternalDeliverResult.Baby> babys = new ArrayList<MaternalDeliverResult.Baby>();
  68 + MaternalDeliverResult maternalDeliverResult = new MaternalDeliverResult();
  69 + for(Fm fm:list){
  70 + maternalDeliverResult.setParentId(fm.getID());
  71 + maternalDeliverResult.setDueDate(fm.getBABY_DELIVERY_TIME());
  72 + maternalDeliverResult.setDueWeek(fm.getDUE_WEEK());
  73 + }
  74 +
  75 +
  76 + }else
  77 + return null;
  78 + }catch (Exception e){
  79 + e.printStackTrace();
  80 + }
  81 +
  82 + return null;
  83 + }
  84 +
  85 +}