123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919 |
- package com.diagbot.util;
- import com.diagbot.entity.*;
- import com.diagbot.vo.data.*;
- import com.diagbot.vo.str.StrCrisisNoteVO;
- import com.google.common.collect.Lists;
- import java.sql.*;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.ResourceBundle;
- public class FJTZDBConnHarp {
- 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");
- public static final Long HOSPITAL_ID=Long.valueOf("7");//1:长兴,2:邵逸夫,3:台州市立医院
- private static Connection connection = null;
- private static PreparedStatement sta = null;
- private static 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 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();
- }
- }
- }
- }
- }
- /**
- * 病案诊断
- * @return
- */
- public List<HomeDiagnoseInfo> getHomeDiagnose(String sql){
- List<HomeDiagnoseInfo> homeDiagnoseVOList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- HomeDiagnoseInfo homeDiagnose=new HomeDiagnoseInfo();
- homeDiagnose.setHomePageId(rs.getString("homePageId"));//病案首页ID
- homeDiagnose.setHospitalId(rs.getLong("hospitalId"));//医院ID
- homeDiagnose.setDiagnoseOrderNo(rs.getString("diagnoseOrderNo"));//诊断序号
- homeDiagnose.setDiagnoseName(rs.getString("diagnoseName"));//诊断名称
- homeDiagnose.setDiagnoseType(rs.getString("diagnoseType"));//诊断类别
- homeDiagnose.setDiagnoseTypeShort(rs.getString("diagnoseTypeShort"));//诊断判别
- homeDiagnose.setBehospitalType(rs.getString("behospitalType"));//入院情况
- homeDiagnose.setLeaveHospitalType(rs.getString("leaveHospitalType"));//出院情况
- // homeDiagnose.setPathologyDiagnose();//病理号
- homeDiagnose.setIcdCode(rs.getString("icdCode"));//诊断编码
- homeDiagnoseVOList.add(homeDiagnose);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return homeDiagnoseVOList;
- }
- /**
- * 病案手术
- * @return
- */
- public List<HomeOperationInfo> getHomeOperation(String sql) {
- List<HomeOperationInfo> homeOperationVOList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- HomeOperationInfo homeOperationVO=new HomeOperationInfo();
- homeOperationVO.setHomePageId(rs.getString("homePageId"));//病案首页ID
- homeOperationVO.setHospitalId(rs.getLong("hospitalId"));//医院ID
- homeOperationVO.setOperationOrderNo(rs.getString("operationOrderNo"));//手术序号
- homeOperationVO.setOperationCode(rs.getString("operationCode"));//手术编码
- homeOperationVO.setOperationDoctorId(rs.getString("operationDoctorId"));//手术医生
- homeOperationVO.setFirstAssistantId(rs.getString("firstAssistantId"));//一助医生
- homeOperationVO.setSecondAssistantId(rs.getString("secondAssistantId"));//二助医生
- homeOperationVO.setCutLevel(rs.getString("cutLevel"));//切口等级
- homeOperationVO.setHealingLevel(rs.getString("healingLevel"));//愈合等级
- homeOperationVO.setOperationName(rs.getString("operationName"));//手术名称
- homeOperationVO.setOperationLevel(rs.getString("operationLevel"));//手术级别
- homeOperationVO.setAnaesthesiaName(rs.getString("anaesthesiaName"));//麻醉方式
- // homeOperationVO.setShamOperationName(rs.getString("shamOperationName"));//拟手术名称
- homeOperationVO.setAnaesthesiaDoctor(rs.getString("anaesthesiaDoctor"));//麻醉医师
- if (null!=rs.getString("operationDate")){
- homeOperationVO.setOperationDate(DateUtil.parseDate(rs.getString("operationDate"),DateUtil.DATE_TIME_FORMAT));//手术日期
- }
- homeOperationVOList.add(homeOperationVO);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- List<HomeOperationInfo> homeOperationList=BeanUtil.listCopyTo(homeOperationVOList, HomeOperationInfo.class);
- return homeOperationList;
- }
- /**
- * 从视图获取病案首页信息
- */
- public List<HisHomePageVO> getHomePage(String sql) {
- List<HisHomePageVO> homePageList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- HisHomePageVO hisHomePageVO =new HisHomePageVO();
- hisHomePageVO.setHomePageId(rs.getString("homePageId"));
- hisHomePageVO.setBehospitalCode(rs.getString("behospitalCode"));
- hisHomePageVO.setHospitalId(rs.getLong("hospitalId"));
- hisHomePageVO.setKeyCn(rs.getString("key_cn"));
- hisHomePageVO.setKeyEn(rs.getString("key_en"));
- hisHomePageVO.setDeValue(rs.getString("de_value"));
- homePageList.add(hisHomePageVO);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return homePageList;
- }
- public List<StructuralDataVo> getBehospitalInfoDate(String sql) {
- List<StructuralDataVo> strings=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- StructuralDataVo structuralDataVo =new StructuralDataVo();
- structuralDataVo.setBehospitalCode(rs.getString("behospitalCode"));//病人住院ID
- structuralDataVo.setPatientId(rs.getString("patientId"));
- strings.add(structuralDataVo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return strings;
- }
- /**
- * 获取病人登录信息
- * @return
- */
- public List<BehospitalInfo> getBehospitalInfo(String sql) {
- List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- BehospitalInfo behospitalInfo=new BehospitalInfo();
- behospitalInfo.setBehospitalCode(rs.getString("behospitalCode"));//病人住院ID
- behospitalInfo.setHospitalId(rs.getLong("hospitalId"));//医院ID
- behospitalInfo.setName(rs.getString("name"));//姓名
- behospitalInfo.setSex(rs.getString("sex"));//性别
- behospitalInfo.setFileCode(rs.getString("fileCode"));//档案号
- behospitalInfo.setWardCode(rs.getString("wardCode"));//病区编码
- behospitalInfo.setWardName(rs.getString("wardName"));//病区名称
- behospitalInfo.setBehDeptId(rs.getString("behDeptId"));//住院科室ID
- behospitalInfo.setBehDeptName(rs.getString("behDeptName"));//住院科室名称
- behospitalInfo.setBedCode(rs.getString("bedCode"));//床位号
- behospitalInfo.setBedName(rs.getString("bedName"));//床位名称
- behospitalInfo.setInsuranceName(rs.getString("insuranceName"));//医保类别
- behospitalInfo.setJobType(rs.getString("jobType"));//职业
- behospitalInfo.setDiagnoseIcd(rs.getString("diagnoseIcd"));//疾病ICD编码
- behospitalInfo.setDiagnose(rs.getString("diagnose"));//疾病名称
- behospitalInfo.setBehDoctorId(rs.getString("behDoctorId"));//住院医生ID
- behospitalInfo.setBehDoctorName(rs.getString("behDoctorName"));//住院医生信息
- behospitalInfo.setDirectorDoctorId(rs.getString("directorDoctorId"));//主任医生ID
- behospitalInfo.setDirectorDoctorName(rs.getString("directorDoctorName"));//主任医生姓名
- behospitalInfo.setDoctorId(rs.getString("doctorId"));//医生ID
- behospitalInfo.setDoctorName(rs.getString("doctorName"));//医生姓名
- if (null!=rs.getString("behospitalDate")) {
- behospitalInfo.setBehospitalDate(DateUtil.parseDate(rs.getString("behospitalDate"),DateUtil.DATE_TIME_FORMAT));//入院时间
- }
- if (null!=rs.getString("leaveHospitalDate")) {
- behospitalInfo.setLeaveHospitalDate(DateUtil.parseDate(rs.getString("leaveHospitalDate"),DateUtil.DATE_FORMAT));//出院日期
- }
- if (null!=rs.getString("birthday")) {
- behospitalInfo.setBirthday(DateUtil.parseDate(rs.getString("birthday"),DateUtil.DATE_FORMAT));//出生日期
- }
- behospitalInfoList.add(behospitalInfo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return behospitalInfoList;
- }
- /**
- * 从视图中获取医嘱信息
- * @return
- */
- public List<DoctorAdvice> getDoctorAdvice(String sql){
- List<DoctorAdvice> doctorAdviceList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- DoctorAdvice doctorAdviceVO=new DoctorAdvice();
- doctorAdviceVO.setDoctorAdviceId(rs.getString("doctorAdviceId"));//病人医嘱ID
- doctorAdviceVO.setHospitalId(rs.getLong("hospitalId"));//医院ID
- doctorAdviceVO.setBehospitalCode(rs.getString("behospitalCode"));//病人ID
- doctorAdviceVO.setOrderDoctorName(rs.getString("orderDoctorName"));//医生开单判别
- doctorAdviceVO.setFrequency(rs.getString("frequency"));//医嘱频率判别
- doctorAdviceVO.setParentTypeId(rs.getString("parentTypeId"));//父类医嘱ID
- doctorAdviceVO.setDoctorAdviceType(rs.getString("doctorAdviceType"));//医嘱类型判别
- doctorAdviceVO.setDose(rs.getString("dose"));//医嘱单次剂量
- doctorAdviceVO.setDoseUnit(rs.getString("doseUnit"));//单次剂量单位
- doctorAdviceVO.setMedModeType(rs.getString("medModeType"));//给药方式
- doctorAdviceVO.setMedicineType(rs.getString("medicineType"));//药品类型
- doctorAdviceVO.setDaItemName(rs.getString("daItemName"));//医嘱项目名称
- doctorAdviceVO.setDoctorId(rs.getString("doctorId"));//开单医生ID
- doctorAdviceVO.setDoctorName(rs.getString("doctorName"));//开单医生姓名
- if (null!=rs.getString("daStartDate")) {
- doctorAdviceVO.setDaStartDate(DateUtil.parseDate(rs.getString("daStartDate"),DateUtil.DATE_TIME_FORMAT));//医嘱开始时间
- }
- if (null!=rs.getString("daStopDate")) {
- doctorAdviceVO.setDaStopDate(DateUtil.parseDate(rs.getString("daStopDate"),DateUtil.DATE_TIME_FORMAT));//医嘱结束时间
- }
- // doctorAdviceVO.setDaFrequency(rs.getString("daFrequency"));//医嘱频率
- // doctorAdviceVO.setDaDealType(rs.getString("daDealType"));//医嘱处理类型
- // doctorAdviceVO.setUsageNum(rs.getString("usageNum"));//一次使用数量
- // doctorAdviceVO.setUsageUnit(rs.getString("usageUnit"));//一次用量单位
- // doctorAdviceVO.setDaStatus(rs.getString("daStatus"));//医嘱状态判别
- // doctorAdviceVO.setDaGroupNo(rs.getString("daGroupNo"));//医嘱同组序号
- // doctorAdviceVO.setDaPrescriptionType(rs.getString("daPrescriptionType"));//医嘱处方类型
- // doctorAdviceVO.setDaMedType(rs.getString("daMedType"));//医嘱领药类型
- // doctorAdviceVO.setDoctorNotice(rs.getString("doctorNotice"));//医生嘱托
- doctorAdviceList.add(doctorAdviceVO);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return doctorAdviceList;
- }
- /**
- * 从视图中获取危急值信息
- * @return
- */
- public List<MedCrisisInfo> getMedCrisisInfo(String sql){
- List<MedCrisisInfo> medCrisisInfos=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- MedCrisisInfo medCrisisInfo=new MedCrisisInfo();
- medCrisisInfo.setRecId(rs.getString("recId"));
- medCrisisInfo.setHospitalId(rs.getLong("hospitalId"));//医院ID
- medCrisisInfo.setBehospitalCode(rs.getString("behospitalCode"));//病人住院ID
- medCrisisInfo.setRecType(rs.getString("recType"));//记录类型
- medCrisisInfo.setCrisisId(rs.getString("crisisId"));//危急值id
- medCrisisInfo.setDeptId(rs.getString("deptId"));//开单科室id
- medCrisisInfo.setDeptName(rs.getString("deptName"));//开单科室姓名
- medCrisisInfo.setDoctorId(rs.getString("doctorId"));//开单医生id
- medCrisisInfo.setDoctorName(rs.getString("doctorName"));//开单医生姓名
- medCrisisInfo.setCrisisValue(rs.getString("crisisValue"));//危急值结果
- medCrisisInfo.setCrisisDesc(rs.getString("crisisDesc"));//危急值描述
- medCrisisInfo.setCrisisLowerValue(rs.getString("crisisLowerValue"));//参考下限
- medCrisisInfo.setCrisisTopValue(rs.getString("crisisTopValue"));//参考上线
- if (null!=rs.getString("repDate")) {
- medCrisisInfo.setRepDate(DateUtil.parseDate(rs.getString("repDate"),DateUtil.DATE_TIME_FORMAT));//报告时间
- }
- medCrisisInfos.add(medCrisisInfo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medCrisisInfos;
- }
- /**
- * 从视图中获取同意书
- * @return
- */
- public List<StrInformedConsent> getStrInformedConsent(String sql){
- List<StrInformedConsent> strInformedConsents=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- StrInformedConsent strInformedConsent =new StrInformedConsent();
- strInformedConsent.setRecId(rs.getString("recId"));
- strInformedConsent.setHospitalId(rs.getLong("hospitalId"));
- strInformedConsent.setBehospitalCode(rs.getString("behospitalCode"));
- strInformedConsent.setRecTitle(rs.getString("recTitle"));
- strInformedConsent.setRecType(rs.getString("recType"));
- strInformedConsents.add(strInformedConsent);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return strInformedConsents;
- }
- /**
- * 从视图中获取告知书
- * @return
- */
- public List<StrTalkInform> getStrTalkInform(String sql){
- List<StrTalkInform> strTalkInforms=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- StrTalkInform strTalkInform =new StrTalkInform();
- strTalkInform.setRecId(rs.getString("recId"));
- strTalkInform.setHospitalId(rs.getLong("hospitalId"));
- strTalkInform.setBehospitalCode(rs.getString("behospitalCode"));
- strTalkInform.setRecTitle(rs.getString("recTitle"));
- strTalkInform.setRecType(rs.getString("recType"));
- strTalkInforms.add(strTalkInform);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return strTalkInforms;
- }
- /**
- * 从视图中获取化验
- * @return
- */
- public List<MedLisResult> getLisResult(String sql){
- List<MedLisResult> medLisResultList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- MedLisResult medLisResult=new MedLisResult();
- medLisResult.setRepNo(rs.getString("recId"));//报告单号
- medLisResult.setHospitalId(rs.getLong("hospitalId"));
- medLisResult.setBehospitalCode(rs.getString("behospitalCode"));//住院病人id
- medLisResult.setItemCode(rs.getString("itemCode"));//报告代码
- medLisResult.setItemName(rs.getString("itemName"));//报告名称
- medLisResult.setResult(rs.getString("result"));//检验结果
- medLisResult.setReferenceMin(rs.getString("referenceMin"));//最小参考值
- medLisResult.setReferenceMax(rs.getString("referenceMax"));//最大参考值
- medLisResult.setUnit(rs.getString("unit"));//单位
- medLisResult.setAbnormal(rs.getString("abnormal"));//异常标志
- // medLisResult.setColor(rs.getString("color"));//异常颜色
- medLisResultList.add(medLisResult);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medLisResultList;
- }
- /**
- * 从视图中获取检查
- * @return
- */
- public List<MedPacsResult> getPacsResult(String sql){
- List<MedPacsResult> medPacsResultList=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- MedPacsResult medPacsResult=new MedPacsResult();
- medPacsResult.setRepNo(rs.getString("recId"));//报告单号
- medPacsResult.setHospitalId(rs.getLong("hospitalId"));
- medPacsResult.setBehospitalCode(rs.getString("behospitalCode"));//住院病人ID
- medPacsResult.setReptName(rs.getString("reptName"));//报告名称
- medPacsResult.setPart(rs.getString("part"));//检查部位
- medPacsResult.setClinicSight(rs.getString("clinicSight"));//检查所见
- medPacsResult.setReptDiag(rs.getString("reptDiag"));//检查结果
- // medPacsResult.setRemark(rs.getString("remark"));//观察记录
- // medPacsResult.setClinicDiag(rs.getString("clinicDiag"));//临床诊断
- medPacsResult.setApplyDoctor(rs.getString("applyDoctor"));//申请医生
- medPacsResult.setCheckerDoctor(rs.getString("checkerDoctor"));//审核医生
- medPacsResult.setReportDoctor(rs.getString("reportDoctor"));//报告医生
- medPacsResult.setDeptName(rs.getString("deptName"));//科室名称
- medPacsResultList.add(medPacsResult);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medPacsResultList;
- }
- /**
- * 从视图中获取检查
- * @return
- */
- public List<MedLisInfo> getLisInfo(String sql){
- List<MedLisInfo> medLisInfos=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- MedLisInfo medLisInfo=new MedLisInfo();
- medLisInfo.setRepNo(rs.getString("recId"));
- medLisInfo.setHospitalId(String.valueOf(rs.getLong("hospitalId")));
- medLisInfo.setBehospitalCode(rs.getString("behospitalCode"));
- medLisInfo.setRepName(rs.getString("repName"));
- medLisInfo.setRepType(rs.getString("repType"));
- medLisInfo.setRepTypeName(rs.getString("repTypeName"));
- medLisInfo.setSlideType(rs.getString("slideType"));
- medLisInfo.setRepDate(rs.getString("repDate"));
- medLisInfo.setCheckDate(rs.getString("checkDate"));
- medLisInfo.setApplyDoctor(rs.getString("applyDoctor"));
- medLisInfos.add(medLisInfo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medLisInfos;
- }
- public List<MedPacsInfo> getPacsInfo(String sql){
- List<MedPacsInfo> medPacsInfos=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- MedPacsInfo medPacsInfo=new MedPacsInfo();
- medPacsInfo.setRepNo(rs.getString("recId"));
- medPacsInfo.setHospitalId(String.valueOf(rs.getLong("hospitalId")));
- medPacsInfo.setBehospitalCode(rs.getString("behospitalCode"));
- medPacsInfo.setRepName(rs.getString("repName"));
- medPacsInfo.setRepType(rs.getString("repType"));
- medPacsInfo.setRepTypeName(rs.getString("repTypeName"));
- medPacsInfo.setPart(rs.getString("part"));
- medPacsInfo.setRepDate(rs.getString("repDate"));
- medPacsInfo.setCheckDate(rs.getString("checkDate"));
- medPacsInfo.setApplyDoctor(rs.getString("applyDoctor"));
- medPacsInfos.add(medPacsInfo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medPacsInfos;
- }
- /**
- * 从视图中获取入院记录
- * @param sql
- * @return
- */
- public List<FJStrAdmissionNoteVo> getMedAdmissionNote(String sql){
- List<FJStrAdmissionNoteVo> strAdmissionNoteVos=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- FJStrAdmissionNoteVo strAdmissionNoteVo=new FJStrAdmissionNoteVo();
- strAdmissionNoteVo.setRecId(rs.getString("recId"));//记录编号
- strAdmissionNoteVo.setHospitalId(rs.getLong("hospitalId"));//医院ID
- strAdmissionNoteVo.setBehospitalCode(rs.getString("behospitalCode"));//病历号
- strAdmissionNoteVo.setName(rs.getString("name"));//姓名
- strAdmissionNoteVo.setSex(rs.getString("sex"));//性别
- strAdmissionNoteVo.setAge(rs.getString("age"));//年龄
- strAdmissionNoteVo.setBedNo(rs.getString("bedNo"));//床号
- strAdmissionNoteVo.setDeptName(rs.getString("deptName"));//科别
- strAdmissionNoteVo.setRecTitle(rs.getString("recTitle"));//标题
- strAdmissionNoteVo.setMarriage(rs.getString("marriage"));//婚姻状况
- strAdmissionNoteVo.setJobType(rs.getString("jobType"));//职业
- strAdmissionNoteVo.setNation(rs.getString("nation"));//民族
- strAdmissionNoteVo.setPhone(rs.getString("phone"));//联系电话
- strAdmissionNoteVo.setWorkplace(rs.getString("workplace"));//工作单位
- strAdmissionNoteVo.setRegisterAddress(rs.getString("registerAddress"));//户口地址
- strAdmissionNoteVo.setBornAddress(rs.getString("bornAddress"));//出生地
- strAdmissionNoteVo.setHistoryTeller(rs.getString("historyTeller"));//病例陈述者
- strAdmissionNoteVo.setRecDoctor(rs.getString("recDoctor"));//记录医生
- strAdmissionNoteVo.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
- strAdmissionNoteVo.setKeyEn(rs.getString("key_en"));
- strAdmissionNoteVo.setKeyCN(rs.getString("key_cn"));
- strAdmissionNoteVo.setDeValue(rs.getString("de_value"));
- if(null!=(rs.getString("recDate"))) {
- strAdmissionNoteVo.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
- }
- if (null!=rs.getString("behospitalDate")){
- strAdmissionNoteVo.setBehospitalDate(DateUtil.parseDate(rs.getString("behospitalDate"),DateUtil.DATE_TIME_FORMAT));//病历日期
- }
- if(null!=(rs.getString("auditDate"))) {
- strAdmissionNoteVo.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
- }
- if (null!=rs.getString("birthday")){
- strAdmissionNoteVo.setBirthday(DateUtil.parseDate(rs.getString("birthday"),DateUtil.DATE_FORMAT));//病历日期
- }
- if (null!=rs.getString("recordDate")){
- strAdmissionNoteVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//病历日期
- }
- strAdmissionNoteVos.add(strAdmissionNoteVo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return strAdmissionNoteVos;
- }
- /**
- * 从视图中获取危急值记录
- * @param sql
- * @return
- */
- public List<AStrCrisisNoteVO> getMedCrisisNote(String sql){
- List<AStrCrisisNoteVO> medCrisisNotes=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- AStrCrisisNoteVO medCrisisNote=new AStrCrisisNoteVO();
- medCrisisNote.setRecId(rs.getString("recId"));//记录编号
- medCrisisNote.setHospitalId(String.valueOf(rs.getLong("hospitalId")));//医院ID
- medCrisisNote.setBehospitalCode(rs.getString("behospitalCode"));//病历号
- medCrisisNote.setName(rs.getString("name"));//姓名
- medCrisisNote.setSex(rs.getString("sex"));//性别
- medCrisisNote.setAge(rs.getString("age"));//年龄
- medCrisisNote.setBedNo(rs.getString("bedNo"));//床号
- medCrisisNote.setDeptName(rs.getString("deptName"));//科别
- medCrisisNote.setRecTitle(rs.getString("recTitle"));//标题
- medCrisisNote.setCrisisNote(rs.getString("crisisNote"));//危急值报告
- medCrisisNote.setBriefNote(rs.getString("briefNote"));//病情分析及处理
- medCrisisNote.setRecordDate(rs.getString("recordDate"));
- medCrisisNote.setRecieveDate(rs.getString("recieveDate"));
- // medCrisisNote.setRecDoctor(rs.getString("recDoctor"));//记录医生
- // medCrisisNote.setRecDate(rs.getDate("recDate"));//记录时间
- // medCrisisNote.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
- // medCrisisNote.setAuditDate(rs.getDate("auditDate"));//审核时间
- // medCrisisNote.setWholeData(rs.getString("wholeData"));//结构化数据
- // medCrisisNote.setRemark(rs.getString(""));//备注
- medCrisisNotes.add(medCrisisNote);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medCrisisNotes;
- }
- /**
- * 从视图中获取查房记录
- * @param sql
- * @return
- */
- public List<StrWardRecord> getMedWardRecord(String sql){
- List<StrWardRecord> medWardRecords=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- StrWardRecord medWardRecord=new StrWardRecord();
- medWardRecord.setRecId(rs.getString("recId"));//记录编号
- medWardRecord.setHospitalId(rs.getLong("hospitalId"));//医院ID
- medWardRecord.setBehospitalCode(rs.getString("behospitalCode"));//病历号
- medWardRecord.setName(rs.getString("name"));//姓名
- medWardRecord.setSex(rs.getString("sex"));//性别
- medWardRecord.setAge(rs.getString("age"));//年龄
- medWardRecord.setBedNo(rs.getString("bedNo"));//床号
- medWardRecord.setDeptName(rs.getString("deptName"));//科别
- medWardRecord.setWardDoctor(rs.getString("wardDoctor"));//查房医生
- medWardRecord.setWardTitle(rs.getString("wardTitle"));//标题
- medWardRecord.setWardContent(rs.getString("wardContent"));//病情记录
- medWardRecord.setWardA(rs.getString("wardS"));// A
- medWardRecord.setWardS(rs.getString("wardO"));// S
- medWardRecord.setWardO(rs.getString("wardA"));// O
- medWardRecord.setWardP(rs.getString("wardP"));// P
- medWardRecord.setRecDoctor(rs.getString("recDoctor"));//记录医生
- medWardRecord.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
- if(null!=(rs.getString("recDate"))) {
- medWardRecord.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
- }
- if(null!=(rs.getString("auditDate"))) {
- medWardRecord.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//审核时间
- }
- if (null!=rs.getString("recordDate")){
- medWardRecord.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//病历日期
- }
- if (null!=rs.getString("wardDate")){
- medWardRecord.setWardDate(DateUtil.parseDate(rs.getString("wardDate"),DateUtil.DATE_TIME_FORMAT));//查房日期
- }
- medWardRecords.add(medWardRecord);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medWardRecords;
- }
- /**
- * 从视图中获取死亡病例讨论记录
- * @param sql
- * @return
- */
- public List<HisViewVo> getMedDeathDiscussion(String sql){
- List<HisViewVo> hisViewVos=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- HisViewVo hisViewVo=new HisViewVo();
- hisViewVo.setRecId(rs.getString("recId"));//记录编号
- hisViewVo.setHospitalId(rs.getLong("hospitalId"));//医院ID
- hisViewVo.setBehospitalCode(rs.getString("behospitalCode"));//病历号
- hisViewVo.setName(rs.getString("name"));//姓名
- hisViewVo.setSex(rs.getString("sex"));//性别
- hisViewVo.setAge(rs.getString("age"));//年龄
- hisViewVo.setBedNo(rs.getString("bedNo"));//床号
- hisViewVo.setDeptName(rs.getString("deptName"));//科别
- hisViewVo.setRecTitle(rs.getString("recTitle"));//标题
- hisViewVo.setRecDoctor(rs.getString("recDoctor"));//记录医生
- hisViewVo.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
- hisViewVo.setContentText(rs.getString("contentText"));//文本
- hisViewVo.setContentText1(rs.getString("contentText1"));//文本1
- hisViewVo.setContentText2(rs.getString("contentText2"));//文本2
- hisViewVo.setKeyEn(rs.getString("key_en"));//字段英文名
- hisViewVo.setKeyCN(rs.getString("key_cn"));//字段中文名
- hisViewVo.setDeValue1(rs.getString("de_value1"));//字段值1
- hisViewVo.setDeValue2(rs.getString("de_value2"));//字段值2
- if(null!=(rs.getString("deathDate"))){
- hisViewVo.setDeathDate(DateUtil.parseDate(rs.getString("deathDate"),DateUtil.DATE_TIME_FORMAT));//死亡时间
- }
- if(null!=(rs.getString("recordDate"))){
- hisViewVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//质控日期
- }
- if(null!=(rs.getString("auditDate"))) {
- hisViewVo.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//审核时间
- }
- if(null!=(rs.getString("recDate"))) {
- hisViewVo.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
- }
- hisViewVos.add(hisViewVo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return hisViewVos;
- }
- /**
- * 从视图中获取死亡记录
- * @param sql
- * @return
- */
- public List<StrDeathNote> getMedDeathNote(String sql){
- List<StrDeathNote> medDeathNotes=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- StrDeathNote medDeathNote=new StrDeathNote();
- medDeathNote.setRecId(rs.getString("recId"));//记录编号
- medDeathNote.setHospitalId(HOSPITAL_ID);//医院ID
- medDeathNote.setBehospitalCode(rs.getString("behospitalCode"));//病历号
- medDeathNote.setName(rs.getString("name"));//姓名
- medDeathNote.setSex(rs.getString("sex"));//性别
- medDeathNote.setAge(rs.getString("age"));//年龄
- medDeathNote.setBedNo(rs.getString("bedNo"));//床号
- medDeathNote.setDeptName(rs.getString("deptName"));//科别
- medDeathNote.setRecordDate(rs.getDate("recordDate"));//病历日期
- medDeathNote.setRecTitle(rs.getString("recTitle"));//标题
- medDeathNote.setBehospitalDate(rs.getDate("behospitalDate"));//入院日期
- medDeathNote.setDeathDate(rs.getDate("deathDate"));//死亡日期
- medDeathNote.setBehospitalSituation(rs.getString("behospitalSituation"));//入院情况
- medDeathNote.setTentativeDiagnosis(rs.getString("tentativeDiagnosis"));//入院诊断
- medDeathNote.setTreatmentProcess(rs.getString("treatmentProcess"));//诊疗经过
- medDeathNote.setDeathReason(rs.getString("deathReason"));//死亡原因
- medDeathNote.setDeathDiagnosis(rs.getString("deathDiagnosis"));//死亡诊断
- medDeathNote.setRecDoctor(rs.getString("recDoctor"));//记录医生
- medDeathNote.setRecDate(rs.getDate("recDate"));//记录时间
- medDeathNote.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
- medDeathNote.setAuditDate(rs.getDate("auditDate"));//审核时间
- medDeathNote.setWholeData(rs.getString("wholeData"));//结构化数据
- medDeathNote.setRemark(rs.getString(""));//备注
- medDeathNotes.add(medDeathNote);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return medDeathNotes;
- }
- /**
- * 从视图中获取文书数据
- * @param sql
- * @return
- */
- public List<HisViewVo> getHisView(String sql){
- List<HisViewVo> hisViewVos=Lists.newLinkedList();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- HisViewVo hisViewVo=new HisViewVo();
- hisViewVo.setRecId(rs.getString("recId"));//记录编号
- hisViewVo.setHospitalId(rs.getLong("hospitalId"));//医院ID
- hisViewVo.setBehospitalCode(rs.getString("behospitalCode"));//病历号
- hisViewVo.setName(rs.getString("name"));//姓名
- hisViewVo.setSex(rs.getString("sex"));//性别
- hisViewVo.setAge(rs.getString("age"));//年龄
- hisViewVo.setBedNo(rs.getString("bedNo"));//床号
- hisViewVo.setDeptName(rs.getString("deptName"));//科别
- hisViewVo.setRecTitle(rs.getString("recTitle"));//标题
- hisViewVo.setRecDoctor(rs.getString("recDoctor"));//记录医生
- hisViewVo.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
- hisViewVo.setContentText(rs.getString("contentText"));//文本
- hisViewVo.setContentText1(rs.getString("contentText1"));//文本1
- hisViewVo.setContentText2(rs.getString("contentText2"));//文本2
- hisViewVo.setKeyEn(rs.getString("key_en"));//字段英文名
- hisViewVo.setKeyCN(rs.getString("key_cn"));//字段中文名
- hisViewVo.setDeValue(rs.getString("de_value"));//字段值
- if(null!=(rs.getString("recordDate"))){
- hisViewVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//质控日期
- }
- if(null!=(rs.getString("auditDate"))) {
- hisViewVo.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//审核时间
- }
- if(null!=(rs.getString("recDate"))) {
- hisViewVo.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
- }
- hisViewVos.add(hisViewVo);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return hisViewVos;
- }
- /**
- * 获取操作的名称
- * @param sql
- * @return
- */
- public List<String> getOpsName(String sql){
- List<String> names =new ArrayList<>();
- try {
- FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
- ResultSet rs =dbconn.Query(sql, null);
- while(rs.next()){
- String name =rs.getString("icd_name");
- names.add(name);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }finally {
- close();
- }
- return names;
- }
- }
|