|
@@ -1,6 +1,23 @@
|
|
package com.diagbot.facade;
|
|
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.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;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -10,4 +27,160 @@ import org.springframework.stereotype.Component;
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
public class HomePageFacade extends HomePageServiceImpl {
|
|
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;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|