lantone %!s(int64=5) %!d(string=hai) anos
pai
achega
288deeb6e7

+ 6 - 1
pom.xml

@@ -182,7 +182,12 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-pool2</artifactId>
         </dependency>
-
+       
+       <dependency>
+      <groupId>com.oracle</groupId>
+      <artifactId>ojdbc6</artifactId>
+      <version>11.2.0.3</version>
+    </dependency>
     </dependencies>
 
     <!-- 私有仓库 -->

+ 2 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -48,6 +48,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/analyze").permitAll()
                 .antMatchers("/cache/clear").permitAll()
                 .antMatchers("/qc/mode/getMenu").permitAll()
+                .antMatchers("/qc/homePageInfo/getHomePage").permitAll()
+                .antMatchers("/qc/homePageInfo/getDoctorAdvice").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

+ 2 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -89,6 +89,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/analyze", request)
                 || matchers("/cache/clear", request)
                 || matchers("/qc/mode/getMenu", request)
+                || matchers("/qc/homePageInfo/getHomePage", request)
+                || matchers("/qc/homePageInfo/getDoctorAdvice", request)
                 || matchers("/", request)) {
             return true;
         }

+ 173 - 0
src/main/java/com/diagbot/facade/HomePageFacade.java

@@ -1,6 +1,23 @@
 package com.diagbot.facade;
 
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomePage;
+import com.diagbot.service.BehospitalInfoService;
+import com.diagbot.service.DoctorAdviceService;
+import com.diagbot.service.HomePageService;
 import com.diagbot.service.impl.HomePageServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DBConn;
+import com.diagbot.util.bean.BehospitalInfoVO;
+import com.diagbot.util.bean.DoctorAdviceVO;
+import com.diagbot.util.bean.HomePageVO;
+import com.google.common.collect.Lists;
+
+import java.sql.ResultSet;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 /**
@@ -10,4 +27,160 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class HomePageFacade extends HomePageServiceImpl {
+	
+	@Autowired
+	private HomePageService homePageService;
+	
+	@Autowired
+	private BehospitalInfoService behospitalInfoService;
+	
+	@Autowired
+	private DoctorAdviceService doctorAdviceService;
+	
+	/**
+	 * 从视图获取病案首页信息
+	 */
+	public Boolean addHomePage() {
+		List<HomePage> homePage=getHomePage();
+		return homePageService.saveBatch(homePage);
+	}
+	
+	private List<HomePage> getHomePage() {
+		List<HomePage> homePageList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from BR_RECHOME_CX where BAZKRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomePageVO homePageVO=new HomePageVO();
+				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homePageVO.setHospitalId(Long.getLong(rs.getString("BASYID").toString()));//医院ID
+				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
+				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
+				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
+				homePageVO.setOrgCode(rs.getString("ZZJGBH"));//医疗机构代码
+				homePageVO.setPayType(rs.getString("YLFKLB"));//医疗付费方式
+				homePageVO.setHealthCard(rs.getString("BRJKKH"));//健康卡号
+				homePageVO.setBehospitalNum(rs.getString("BRZYCS"));//住院次数
+				homePageVO.setFileCode(rs.getString("BRBABH"));//病案号
+				homePageVO.setName(rs.getString("BRBAXM"));//姓名
+				homePageVO.setSex(rs.getString("BRBAXB"));//性别
+				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				
+				HomePage homePage=new HomePage();
+				BeanUtil.copyProperties(homePageVO, homePage);
+				homePageList.add(homePage);
+				
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return homePageList;
+	}
+	
+	/**
+	 * 从视图中获取医嘱信息
+	 * @return
+	 */
+	public Boolean addDoctorAdvice() {
+		List<DoctorAdvice> doctorAdviceList=getDoctorAdvice();
+		return doctorAdviceService.saveBatch(doctorAdviceList);
+	}
+	
+	private List<DoctorAdvice> getDoctorAdvice(){
+		List<DoctorAdvice> doctorAdviceList=Lists.newLinkedList();
+		
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from BR_DOCTADVICE_CX where CJCXRQ BETWEEN TO_DATE('2020-03-01', 'yyyy-MM-dd') and TO_DATE('2020-03-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				DoctorAdviceVO doctorAdviceVO=new DoctorAdviceVO();
+				doctorAdviceVO.setDoctorAdviceId(rs.getString("BRYZID"));//病人医嘱ID
+				doctorAdviceVO.setHospitalId(Long.getLong("1"));//医院ID
+				doctorAdviceVO.setBehospitalCode(rs.getString("BRYZID"));//病人ID
+				doctorAdviceVO.setOrderDoctorName(rs.getString("YSKDPB"));//医生开单判别
+				doctorAdviceVO.setFrequency(rs.getString("YZPLPB"));//医嘱频率判别
+				doctorAdviceVO.setParentTypeId(rs.getString("FLYZID"));//父类医嘱ID
+				doctorAdviceVO.setDoctorAdviceType(rs.getString("YZLXPB"));//医嘱类型判别
+				doctorAdviceVO.setUsageNum(rs.getString("YCSYSL"));//一次使用数量
+				doctorAdviceVO.setUsageUnit(rs.getString("YCYLDW"));//一次用量单位
+				doctorAdviceVO.setDose(rs.getString("YZDCJL"));//医嘱单次剂量
+				doctorAdviceVO.setDoseUnit(rs.getString("DCJLDW"));//单次剂量单位
+				doctorAdviceVO.setMedModeType(rs.getString("GYFSID"));//给药方式
+				doctorAdviceVO.setDaFrequency(rs.getString("YZPLID"));//医嘱频率
+				doctorAdviceVO.setDaDealType(rs.getString("YZCLLX"));//医嘱处理类型
+				doctorAdviceVO.setDaStartDate(rs.getDate("YZKSSJ"));//医嘱开始时间
+				doctorAdviceVO.setDaItemName(rs.getString("YZXMMC"));//医嘱项目名称
+				doctorAdviceVO.setDaStatus(rs.getString("YZZTPB"));//医嘱状态判别
+				doctorAdviceVO.setDaStopDate(rs.getDate("YZJSSJ"));//医嘱结束时间
+				doctorAdviceVO.setDaGroupNo(rs.getString("YZTZXH"));//医嘱同组序号
+				doctorAdviceVO.setDaPrescriptionType(rs.getString("YZCFLX"));//医嘱处方类型
+				doctorAdviceVO.setDaMedType(rs.getString("YZLYLX"));//医嘱领药类型
+				doctorAdviceVO.setDoctorNotice(rs.getString("YSZTSM"));//医生嘱托
+				doctorAdviceVO.setDoctorId(rs.getString("KDYSID"));//开单医生ID
+				doctorAdviceVO.setDoctorName(rs.getString("KDYSXM"));//开单医生姓名
+				
+				DoctorAdvice doctorAdvice=new DoctorAdvice();
+				BeanUtil.copyProperties(doctorAdviceVO, doctorAdvice);
+				
+				doctorAdviceList.add(doctorAdvice);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return doctorAdviceList;
+	}
+	
+	/**
+	 * 获取病历信息
+	 * @return
+	 */
+	public Boolean addBehospitalInfo() {
+		List<BehospitalInfo> behospitalInfoList=getBehospitalInfo();
+		return behospitalInfoService.saveBatch(behospitalInfoList);
+	}
+	
+	private List<BehospitalInfo> getBehospitalInfo() {
+		List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from BR_RECHOME_CX where BAZKRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BehospitalInfoVO behospitalInfoVO=new BehospitalInfoVO();
+				/*
+				behospitalInfoVO.setBehospitalCode(rs.getString("BASYID"));//病人住院ID
+				behospitalInfoVO.setHospitalId(hospitalId);//医院ID
+				behospitalInfoVO.setName(name);//姓名
+				behospitalInfoVO.setSex(sex);//性别
+				behospitalInfoVO.setBirthday(birthday);//出生日期
+				behospitalInfoVO.setFileCode(fileCode);//档案号
+				behospitalInfoVO.setWardCode(wardCode);//病区编码
+				behospitalInfoVO.setWardName(wardName);//病区名称
+				behospitalInfoVO.setBehDeptId(behDeptId);//住院科室ID
+				behospitalInfoVO.setBehDeptName(behDeptName);//住院科室名称
+				behospitalInfoVO.setBedCode(bedCode);//床位号
+				behospitalInfoVO.setBedName(bedName);//床位名称
+				behospitalInfoVO.setInsuranceName(insuranceName);//医保类别
+				behospitalInfoVO.setJobType(jobType);//职业
+				behospitalInfoVO.setBehospitalDate(behospitalDate);//入院时间
+				behospitalInfoVO.setLeaveHospitalDate(leaveHospitalDate);//出院时间
+				behospitalInfoVO.setDiagnoseIcd(diagnoseIcd);//疾病ICD编码
+				behospitalInfoVO.setDiagnose(diagnose);//疾病名称
+				behospitalInfoVO.setDoctorId(doctorId);//医生ID
+				behospitalInfoVO.setDoctorName(doctorName);//医生姓名
+				*/
+				BehospitalInfo behospitalInfo=new BehospitalInfo();
+				BeanUtil.copyProperties(behospitalInfoVO, behospitalInfo);
+				behospitalInfoList.add(behospitalInfo);
+				
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return behospitalInfoList;
+	}
+	
 }

+ 196 - 86
src/main/java/com/diagbot/util/DBConn.java

@@ -1,96 +1,206 @@
 package com.diagbot.util;
 
-import java.io.File;
-import java.io.FileOutputStream;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ResourceBundle;
 
 public class DBConn {
-	public static void main(String[] args) throws Exception{
-
-        String username = "root";// 数据库用户名
-        String password = "langtong";// 数据库密码
-
-        //sqlServer
-        String sqlServerDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-        String sqlServerUrl = "jdbc:sqlserver://192.1.2.92:1433;DatabaseName=lis";
-
-        //mysql8.0以上
-        String mysqlHighDriver = "com.mysql.cj.jdbc.Driver";
-        String mysqlHighUrl = "jdbc:mysql://localhost:3306/RUNOOB?useSSL=false&serverTimezone=UTC";
-
-        //mysql8.0以下
-        String mysqlLowDriver = "com.mysql.jdbc.Driver";
-        String mysqlLowUrl = "jdbc:mysql://localhost:3306/world";
-
-        //oracle
-        String oracleDriver = "oracle.jdbc.OracleDriver";
-        String oracleUrl = "jdbc:oracle:thin:@localhost:1521:XE";
-
-        File file1;
-        File file2;
-
-        FileOutputStream fop = null;
-
-        Connection conn = null;
-        try {
-            Class.forName(mysqlLowDriver);
-            conn = DriverManager.getConnection(mysqlLowUrl, username, password);
-
-            /*System.out.println("国家代码:");
-            Scanner input = new Scanner(System.in);
-            input.useDelimiter("\n");
-            String countryCode = input.next();*/
-
-            PreparedStatement pst = null;
-            pst =  conn.prepareStatement("select DISTINCT (CountryCode) from city");
-            ResultSet rs = pst.executeQuery();
-
-            while(rs.next()){
-                String filePar = "C:/Users/94556/Desktop/test/" + rs.getString("CountryCode");// 文件夹路径
-                file1 = new File(filePar);
-                if (!file1.exists()) {
-                    file1.mkdirs();
-                }
-
-                PreparedStatement pst1 = null;
-                pst1 =  conn.prepareStatement("select * from city where CountryCode = '" + rs.getString("CountryCode") +"'");
-                ResultSet rs1 = pst1.executeQuery();
-
-                while(rs1.next()){
-
-                    file2 = new File("C:/Users/94556/Desktop/test/" + rs.getString("CountryCode") + "/" + rs1.getString("Name") + ".txt");
-                    fop = new FileOutputStream(file2);
-
-                    if (!file2.exists()) {
-                        file2.createNewFile();
-                    }
-
-                    StringBuffer content = new StringBuffer("城市:" + rs1.getString("Name") +
-                            ",国家代号:" + rs1.getString("CountryCode") +
-                            ",行政区:" + rs1.getString("District") +
-                            ",人口:" + rs1.getString("Population") + "\n");
-
-                    byte[] contentInBytes = content.toString().getBytes();
-                    fop.write(contentInBytes);
-
-                }
-                fop.flush();
-                fop.close();
-
-                rs1.close();
-                pst1.close();
-            }
-
-            rs.close();
-            pst.close();
-            conn.close();
-
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+	
+	private static final String DRIVER = getValue("jdbc.driverClassName");
+    private static final String URL = getValue("jdbc.url");
+    private static final String USERNAME = getValue("jdbc.username");
+    private static final String PASSWORD = getValue("jdbc.password");
+    
+    private Connection connection = null;
+    private PreparedStatement sta = null;
+	private ResultSet rs = null;
+	
+	/**
+     * 读取属性文件中的信息
+     *
+     * @param key
+     * @return
+     */
+    private static String getValue(String key) {
+        // 资源包绑定
+        ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
+        return bundle.getString(key);
     }
+    
+    /**
+	 * 加载驱动程序
+	 */
+	static {
+		try {
+			Class.forName(DRIVER);
+		} catch (ClassNotFoundException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * @return 连接对象
+	 */
+	public Connection getConnection() {
+		try {
+			connection = DriverManager.getConnection(URL,USERNAME,PASSWORD);
+		} catch (SQLException e) {
+
+			e.printStackTrace();
+		}
+		return connection;
+	}
+
+
+	/**
+	 * @param sql
+	 *            sql语句  增加,删除,修改
+	 * @param obj
+	 *            参数
+	 * @return
+	 */
+	public int update(String sql, Object... obj) {
+		int count = 0;
+		connection = getConnection();
+		try {
+			sta = connection.prepareStatement(sql);
+			if (obj != null) {
+				for (int i = 0; i < obj.length; i++) {
+					sta.setObject(i + 1, obj[i]);
+				}
+			}
+			count = sta.executeUpdate();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally{
+		
+			close();
+		}
+		return count;
+	}
+
+	/**
+	 * @param sql sql语句
+	 * @param obj 参数
+	 * @return 数据集合
+	 */
+	public ResultSet Query(String sql,Object...obj){
+		connection=getConnection();
+		try {
+			sta=connection.prepareStatement(sql);
+			if(obj!=null){
+				for(int i=0;i<obj.length;i++){
+					sta.setObject(i+1, obj[i]);
+				}
+			}
+			rs=sta.executeQuery();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+		return rs;
+	}
+	
+	/**
+	 * 关闭资源
+	 */
+	public void close() {
+		try {
+			if (rs != null) {
+				rs.close();
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				if (sta != null) {
+					sta.close();
+				}
+			} catch (SQLException e2) {
+				e2.printStackTrace();
+			} finally {
+				if (connection != null) {
+					try {
+						connection.close();
+					} catch (SQLException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+		}
+	}
+
+	public static void main(String[] args) throws Exception {
+		DBConn dbconn=new DBConn();
+		String sql="select * from BR_RECHOME_CX";
+		ResultSet rs1 =dbconn.Query(sql, null);
+		while(rs1.next()){
+			String BRZYID=rs1.getString("BRZYID");
+		}
+		//System.out.println(getConnection());
+		/*
+		 * String username = "root";// 数据库用户名 String password = "langtong";// 数据库密码
+		 * 
+		 * //sqlServer String sqlServerDriver =
+		 * "com.microsoft.sqlserver.jdbc.SQLServerDriver"; String sqlServerUrl =
+		 * "jdbc:sqlserver://192.1.2.92:1433;DatabaseName=lis";
+		 * 
+		 * //mysql8.0以上 String mysqlHighDriver = "com.mysql.cj.jdbc.Driver"; String
+		 * mysqlHighUrl =
+		 * "jdbc:mysql://localhost:3306/RUNOOB?useSSL=false&serverTimezone=UTC";
+		 * 
+		 * //mysql8.0以下 String mysqlLowDriver = "com.mysql.jdbc.Driver"; String
+		 * mysqlLowUrl = "jdbc:mysql://localhost:3306/world";
+		 * 
+		 * //oracle String oracleDriver = "oracle.jdbc.OracleDriver"; String oracleUrl =
+		 * "jdbc:oracle:thin:@localhost:1521:XE";
+		 * 
+		 * File file1; File file2;
+		 * 
+		 * FileOutputStream fop = null;
+		 * 
+		 * Connection conn = null; try { Class.forName(mysqlLowDriver); conn =
+		 * DriverManager.getConnection(mysqlLowUrl, username, password);
+		 * 
+		 * System.out.println("国家代码:"); Scanner input = new Scanner(System.in);
+		 * input.useDelimiter("\n"); String countryCode = input.next();
+		 * 
+		 * PreparedStatement pst = null; pst =
+		 * conn.prepareStatement("select DISTINCT (CountryCode) from city"); ResultSet
+		 * rs = pst.executeQuery();
+		 * 
+		 * while(rs.next()){ String filePar = "C:/Users/94556/Desktop/test/" +
+		 * rs.getString("CountryCode");// 文件夹路径 file1 = new File(filePar); if
+		 * (!file1.exists()) { file1.mkdirs(); }
+		 * 
+		 * PreparedStatement pst1 = null; pst1 =
+		 * conn.prepareStatement("select * from city where CountryCode = '" +
+		 * rs.getString("CountryCode") +"'"); ResultSet rs1 = pst1.executeQuery();
+		 * 
+		 * while(rs1.next()){
+		 * 
+		 * file2 = new File("C:/Users/94556/Desktop/test/" + rs.getString("CountryCode")
+		 * + "/" + rs1.getString("Name") + ".txt"); fop = new FileOutputStream(file2);
+		 * 
+		 * if (!file2.exists()) { file2.createNewFile(); }
+		 * 
+		 * StringBuffer content = new StringBuffer("城市:" + rs1.getString("Name") +
+		 * ",国家代号:" + rs1.getString("CountryCode") + ",行政区:" + rs1.getString("District")
+		 * + ",人口:" + rs1.getString("Population") + "\n");
+		 * 
+		 * byte[] contentInBytes = content.toString().getBytes();
+		 * fop.write(contentInBytes);
+		 * 
+		 * } fop.flush(); fop.close();
+		 * 
+		 * rs1.close(); pst1.close(); }
+		 * 
+		 * rs.close(); pst.close(); conn.close();
+		 * 
+		 * 
+		 * } catch (Exception e) { e.printStackTrace(); }
+		 */
+	}
 }

+ 30 - 0
src/main/java/com/diagbot/util/ReadProperties.java

@@ -13,6 +13,18 @@ public class ReadProperties {
 	
 	@Value(value="${remote.address.hor}")
 	public String remoteAddressHor;
+	
+	@Value(value="${jdbc.driverClassName}")
+	public String jdbcDriverClassName;
+	
+	@Value(value="${jdbc.url}")
+	public String jdbcUrl;
+	
+	@Value(value="${jdbc.username}")
+	public String jdbcUsername;
+	
+	@Value(value="${jdbc.password}")
+	public String jdbcPassword;
 
 	public String getRemoteAddressVer() {
 		return remoteAddressVer;
@@ -28,5 +40,23 @@ public class ReadProperties {
 	public String getHisPatientUrl() {
 		return hisPatientUrl;
 	}
+
+	public String getJdbcDriverClassName() {
+		return jdbcDriverClassName;
+	}
+
+	public String getJdbcUrl() {
+		return jdbcUrl;
+	}
+
+	public String getJdbcUsername() {
+		return jdbcUsername;
+	}
+
+	public String getJdbcPassword() {
+		return jdbcPassword;
+	}
+	
+	
 	
 }

+ 114 - 0
src/main/java/com/diagbot/util/bean/BehospitalInfoVO.java

@@ -0,0 +1,114 @@
+package com.diagbot.util.bean;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class BehospitalInfoVO implements Serializable{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private String hospitalId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private Date birthday;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 病区编码
+     */
+    private String wardCode;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 住院科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+    /**
+     * 床位号
+     */
+    private String bedCode;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 医保类别
+     */
+    private String insuranceName;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
+    /**
+     * 疾病ICD编码
+     */
+    private String diagnoseIcd;
+
+    /**
+     * 疾病名称
+     */
+    private String diagnose;
+
+    /**
+     * 医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+}

+ 134 - 0
src/main/java/com/diagbot/util/bean/DoctorAdviceVO.java

@@ -0,0 +1,134 @@
+package com.diagbot.util.bean;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class DoctorAdviceVO implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	
+	/**
+     * 病人医嘱ID
+     */
+    private String doctorAdviceId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医生开单判别
+     */
+    private String orderDoctorName;
+
+    /**
+     * 医嘱频率判别
+     */
+    private String frequency;
+
+    /**
+     * 父类医嘱ID
+     */
+    private String parentTypeId;
+
+    /**
+     * 医嘱类型判别(嘱托长嘱、长期医嘱等)
+     */
+    private String doctorAdviceType;
+
+    /**
+     * 一次使用数量
+     */
+    private String usageNum;
+
+    /**
+     * 一次用量单位
+     */
+    private String usageUnit;
+
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
+
+    /**
+     * 医嘱处理类型
+     */
+    private String daDealType;
+
+    /**
+     * 医嘱开始时间
+     */
+    private Date daStartDate;
+
+    /**
+     * 医嘱项目名称
+     */
+    private String daItemName;
+
+    /**
+     * 医嘱状态判别
+     */
+    private String daStatus;
+
+    /**
+     * 医嘱结束时间
+     */
+    private Date daStopDate;
+
+    /**
+     * 医嘱同组序号
+     */
+    private String daGroupNo;
+
+    /**
+     * 医嘱处方类型(检验、描述医嘱、膳食、西药、护理等)
+     */
+    private String daPrescriptionType;
+
+    /**
+     * 医嘱领药类型
+     */
+    private String daMedType;
+
+    /**
+     * 医生嘱托
+     */
+    private String doctorNotice;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+}

+ 669 - 0
src/main/java/com/diagbot/util/bean/HomePageVO.java

@@ -0,0 +1,669 @@
+package com.diagbot.util.bean;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class HomePageVO implements Serializable{
+	
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * 病案首页编号
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构id
+     */
+    private String hospitalCode;
+
+    /**
+     * 医疗机构名称
+     */
+    private String hospitalName;
+
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 医疗付费方式
+     */
+    private String payType;
+
+    /**
+     * 健康卡号
+     */
+    private String healthCard;
+
+    /**
+     * 住院次数
+     */
+    private String behospitalNum;
+
+    /**
+     * 病案号
+     */
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private Date birthday;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 年龄单位
+     */
+    private String ageUnit;
+
+    /**
+     * 国籍
+     */
+    private String nationality;
+
+    /**
+     * 新生儿出生月数
+     */
+    private String newbornMonth;
+
+    /**
+     * 新生儿出生天数
+     */
+    private String newbornDay;
+
+    /**
+     * 新生儿出生体重
+     */
+    private String newbornWeight;
+
+    /**
+     * 新生儿入院体重
+     */
+    private String newbornBehospitalWeight;
+
+    /**
+     * 出生地
+     */
+    private String bornAddress;
+
+    /**
+     * 籍贯
+     */
+    private String bornPlace;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 身份证号
+     */
+    private String identityCardNo;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 婚姻
+     */
+    private String marriage;
+
+    /**
+     * 现住址
+     */
+    private String curAddress;
+
+    /**
+     * 现住址电话
+     */
+    private String curPhone;
+
+    /**
+     * 现住址邮编
+     */
+    private String curPostCode;
+
+    /**
+     * 户口地址
+     */
+    private String residenceAddress;
+
+    /**
+     * 户口地址邮编
+     */
+    private String residencePostCode;
+
+    /**
+     * 工作单位
+     */
+    private String workAddress;
+
+    /**
+     * 工作单位电话
+     */
+    private String workPhone;
+
+    /**
+     * 工作单位邮编
+     */
+    private String workPostCode;
+
+    /**
+     * 联系人姓名
+     */
+    private String contactName;
+
+    /**
+     * 联系人关系
+     */
+    private String contactRelation;
+
+    /**
+     * 联系人地址
+     */
+    private String contactAddress;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 入院途径
+     */
+    private String behospitalWay;
+
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 入院科别
+     */
+    private String behospitalDept;
+
+    /**
+     * 入院病房
+     */
+    private String behospitalWard;
+
+    /**
+     * 入院床位序号
+     */
+    private String behospitalBedId;
+
+    /**
+     * 入院床位号码
+     */
+    private String behospitalBedCode;
+
+    /**
+     * 转科科别
+     */
+    private String changeDept;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
+    /**
+     * 出院科别
+     */
+    private String leaveHospitalDept;
+
+    /**
+     * 出院病房
+     */
+    private String leaveHospitalWard;
+
+    /**
+     * 出院床位序号
+     */
+    private String leaveHospitalBedId;
+
+    /**
+     * 出院床位号码
+     */
+    private String leaveHospitalBedCode;
+
+    /**
+     * 实际住院天数
+     */
+    private String behospitalDayNum;
+
+    /**
+     * 门急诊诊断
+     */
+    private String outpatientEmrDiagnose;
+
+    /**
+     * 门急诊诊断编码
+     */
+    private String outpatientEmrDiagnoseCode;
+
+    /**
+     * 损伤中毒因素
+     */
+    private String poisonFactor;
+
+    /**
+     * 损伤中毒因素编码
+     */
+    private String poisonFactorCode;
+
+    /**
+     * 病理诊断
+     */
+    private String pathologyDiagnose;
+
+    /**
+     * 病理诊断编码
+     */
+    private String pathologyDiagnoseCode;
+
+    /**
+     * 病理诊断编号
+     */
+    private String pathologyDiagnoseId;
+
+    /**
+     * 药物过敏
+     */
+    private String isMedAllergy;
+
+    /**
+     * 过敏药物
+     */
+    private String medAllergyName;
+
+    /**
+     * 死亡患者尸检
+     */
+    private String autopsy;
+
+    /**
+     * 血型
+     */
+    private String bloodType;
+
+    /**
+     * Rh
+     */
+    private String rh;
+
+    /**
+     * 科主任
+     */
+    private String deptDirector;
+
+    /**
+     * 主任医师
+     */
+    private String directorDoctor;
+
+    /**
+     * 主治医师
+     */
+    private String attendingDoctor;
+
+    /**
+     * 住院医师
+     */
+    private String behospitalDoctor;
+
+    /**
+     * 责任护士
+     */
+    private String responseNurse;
+
+    /**
+     * 进修医师
+     */
+    private String studyDoctor;
+
+    /**
+     * 实习医师
+     */
+    private String practiceDoctor;
+
+    /**
+     * 编码员
+     */
+    private String encodeMan;
+
+    /**
+     * 病案质量
+     */
+    private String homePageQuality;
+
+    /**
+     * 质控医师
+     */
+    private String qcDoctor;
+
+    /**
+     * 质控护士
+     */
+    private String qcNurse;
+
+    /**
+     * 质控日期
+     */
+    private Date qcDate;
+
+    /**
+     * 离院方式
+     */
+    private String leaveHospitalType;
+
+    /**
+     * 接收机构名称
+     */
+    private String acceptOrgCode;
+
+    /**
+     * 31天内再住院计划
+     */
+    private String againBehospitalPlan;
+
+    /**
+     * 再住院目的
+     */
+    private String againBehospitalGoal;
+
+    /**
+     * 颅脑损伤患者昏迷前天数
+     */
+    private String tbiBeforeDay;
+
+    /**
+     * 颅脑损伤患者昏迷前小时
+     */
+    private String tbiBeforeHour;
+
+    /**
+     * 颅脑损伤患者昏迷前分钟
+     */
+    private String tbiBeforeMinute;
+
+    /**
+     * 颅脑损伤患者昏迷后天数
+     */
+    private String tbiAfterDay;
+
+    /**
+     * 颅脑损伤患者昏迷后小时
+     */
+    private String tbiAfterHour;
+
+    /**
+     * 颅脑损伤患者昏迷后分钟
+     */
+    private String tbiAfterMinute;
+
+    /**
+     * 总费用
+     */
+    private String totalFee;
+
+    /**
+     * 自付金额
+     */
+    private String ownFee;
+
+    /**
+     * 一般医疗服务费
+     */
+    private String generalFee;
+
+    /**
+     * 一般治疗服务费
+     */
+    private String serviceFee;
+
+    /**
+     * 护理费
+     */
+    private String nurseFee;
+
+    /**
+     * 其他费用
+     */
+    private String otherFee;
+
+    /**
+     * 病理诊断费
+     */
+    private String pathologyFee;
+
+    /**
+     * 实验室诊断费
+     */
+    private String labFee;
+
+    /**
+     * 影像学诊断费
+     */
+    private String pacsFee;
+
+    /**
+     * 临床诊断项目费
+     */
+    private String clinicDiagnoseFee;
+
+    /**
+     * 非手术治疗项目费
+     */
+    private String notOperationFee;
+
+    /**
+     * 临床物理治疗费
+     */
+    private String clinicPhysicFee;
+
+    /**
+     * 手术治疗费
+     */
+    private String operationTreatFee;
+
+    /**
+     * 麻醉费
+     */
+    private String anaesthesiaFee;
+
+    /**
+     * 手术费
+     */
+    private String operationFee;
+
+    /**
+     * 康复类
+     */
+    private String healthTypeFee;
+
+    /**
+     * 中医治疗费
+     */
+    private String chnTreatFee;
+
+    /**
+     * 西药费
+     */
+    private String westernMedFee;
+
+    /**
+     * 抗菌药物费用
+     */
+    private String antibiosisFee;
+
+    /**
+     * 中成药费
+     */
+    private String chnMedFee;
+
+    /**
+     * 中草药费
+     */
+    private String chnHerbFee;
+
+    /**
+     * 血费
+     */
+    private String bloodFee;
+
+    /**
+     * 白蛋白类制品费
+     */
+    private String albumenFee;
+
+    /**
+     * 球蛋白类制品费
+     */
+    private String globulinFee;
+
+    /**
+     * 凝血因子类制品费
+     */
+    private String bloodFactorFee;
+
+    /**
+     * 细胞因子类制品费
+     */
+    private String cellFactorFee;
+
+    /**
+     * 检查用一次性医用材料费
+     */
+    private String checkMaterialFee;
+
+    /**
+     * 治疗用一次性医用材料费
+     */
+    private String treatMaterialFee;
+
+    /**
+     * 手术用一次性医用材料费
+     */
+    private String operationMaterialFee;
+
+    /**
+     * 其他类其他费
+     */
+    private String otherTypeFee;
+
+    /**
+     * 单病种管理
+     */
+    private String singleDiagManage;
+
+    /**
+     * 临床路径管理
+     */
+    private String clinicPathwayManage;
+
+    /**
+     * 门诊与住院
+     */
+    private String isOutpatientBehospital;
+
+    /**
+     * 入院与出院
+     */
+    private String isLeaveBehospital;
+
+    /**
+     * 术前与术后
+     */
+    private String isOperationBeforeAfter;
+
+    /**
+     * 临床与病理
+     */
+    private String isClinicPathology;
+
+    /**
+     * 放射与病理
+     */
+    private String isRadiatePathology;
+
+    /**
+     * 病人抢救次数
+     */
+    private String rescueNum;
+
+    /**
+     * 病人抢救成功次数
+     */
+    private String rescueSuccessNum;
+
+    /**
+     * 是否为自动出院
+     */
+    private String isAutoLeavehospital;
+
+    /**
+     * 转归情况
+     */
+    private String returnToType;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+}

+ 39 - 0
src/main/java/com/diagbot/web/HomePageController.java

@@ -0,0 +1,39 @@
+package com.diagbot.web;
+
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.HomePageFacade;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("/qc/homePageInfo")
+@Api(value = "病案首页API", tags = { "病案首页API" })
+@SuppressWarnings("unchecked")
+public class HomePageController {
+
+	@Autowired
+    private HomePageFacade homePageFacade;
+	
+	@ApiOperation(value = "获取医院病案首页信息[by:gaodm]",notes = "")
+	@PostMapping("/getHomePage")
+	@SysLogger("getHomePage")
+	public RespDTO<Boolean> getHomePage() {
+		return RespDTO.onSuc(homePageFacade.addHomePage());
+	}
+	
+	@ApiOperation(value = "获取医院医嘱信息[by:gaodm]",notes = "")
+	@PostMapping("/getDoctorAdvice")
+	@SysLogger("getDoctorAdvice")
+	public RespDTO<Boolean> getDoctorAdvice() {
+		return RespDTO.onSuc(homePageFacade.addDoctorAdvice());
+	}
+	
+}

+ 1 - 1
src/main/resources/jdbc.properties

@@ -5,7 +5,7 @@
 #jdbc.password=root
 
 jdbc.driverClassName=oracle.jdbc.OracleDriver
-jdbc.url=jdbc:oracle:thin:@192.168.2.246:1521:ETRACKMRQC
+jdbc.url=jdbc:oracle:thin:@192.168.2.246:1521:ORCL
 jdbc.username=ETRACKMRQC
 jdbc.password=ETRACKMRQC