FJTZDBConnHarp.java 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. package com.diagbot.util;
  2. import com.diagbot.entity.*;
  3. import com.diagbot.vo.data.*;
  4. import com.diagbot.vo.str.StrCrisisNoteVO;
  5. import com.google.common.collect.Lists;
  6. import java.sql.*;
  7. import java.util.ArrayList;
  8. import java.util.List;
  9. import java.util.ResourceBundle;
  10. public class FJTZDBConnHarp {
  11. private static final String DRIVER = getValue("jdbc.driverClassName");
  12. private static final String URL = getValue("jdbc.url");
  13. private static final String USERNAME = getValue("jdbc.username");
  14. private static final String PASSWORD = getValue("jdbc.password");
  15. public static final Long HOSPITAL_ID=Long.valueOf("7");//1:长兴,2:邵逸夫,3:台州市立医院
  16. private static Connection connection = null;
  17. private static PreparedStatement sta = null;
  18. private static ResultSet rs = null;
  19. /**
  20. * 读取属性文件中的信息
  21. *
  22. * @param key
  23. * @return
  24. */
  25. private static String getValue(String key) {
  26. // 资源包绑定
  27. ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
  28. return bundle.getString(key);
  29. }
  30. /**
  31. * 加载驱动程序
  32. */
  33. static {
  34. try {
  35. Class.forName(DRIVER);
  36. } catch (ClassNotFoundException e) {
  37. e.printStackTrace();
  38. }
  39. }
  40. /**
  41. * @return 连接对象
  42. */
  43. public Connection getConnection() {
  44. try {
  45. connection = DriverManager.getConnection(URL,USERNAME,PASSWORD);
  46. } catch (SQLException e) {
  47. e.printStackTrace();
  48. }
  49. return connection;
  50. }
  51. /**
  52. * @param sql sql语句
  53. * @param obj 参数
  54. * @return 数据集合
  55. */
  56. public ResultSet Query(String sql,Object...obj){
  57. connection=getConnection();
  58. try {
  59. sta=connection.prepareStatement(sql);
  60. if(obj!=null){
  61. for(int i=0;i<obj.length;i++){
  62. sta.setObject(i+1, obj[i]);
  63. }
  64. }
  65. rs=sta.executeQuery();
  66. } catch (SQLException e) {
  67. e.printStackTrace();
  68. }
  69. return rs;
  70. }
  71. /**
  72. * 关闭资源
  73. */
  74. public void close() {
  75. try {
  76. if (rs != null) {
  77. rs.close();
  78. }
  79. } catch (SQLException e) {
  80. e.printStackTrace();
  81. } finally {
  82. try {
  83. if (sta != null) {
  84. sta.close();
  85. }
  86. } catch (SQLException e2) {
  87. e2.printStackTrace();
  88. } finally {
  89. if (connection != null) {
  90. try {
  91. connection.close();
  92. } catch (SQLException e) {
  93. e.printStackTrace();
  94. }
  95. }
  96. }
  97. }
  98. }
  99. /**
  100. * 病案诊断
  101. * @return
  102. */
  103. public List<HomeDiagnoseInfo> getHomeDiagnose(String sql){
  104. List<HomeDiagnoseInfo> homeDiagnoseVOList=Lists.newLinkedList();
  105. try {
  106. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  107. ResultSet rs =dbconn.Query(sql, null);
  108. while(rs.next()){
  109. HomeDiagnoseInfo homeDiagnose=new HomeDiagnoseInfo();
  110. homeDiagnose.setHomePageId(rs.getString("homePageId"));//病案首页ID
  111. homeDiagnose.setHospitalId(rs.getLong("hospitalId"));//医院ID
  112. homeDiagnose.setDiagnoseOrderNo(rs.getString("diagnoseOrderNo"));//诊断序号
  113. homeDiagnose.setDiagnoseName(rs.getString("diagnoseName"));//诊断名称
  114. homeDiagnose.setDiagnoseType(rs.getString("diagnoseType"));//诊断类别
  115. homeDiagnose.setDiagnoseTypeShort(rs.getString("diagnoseTypeShort"));//诊断判别
  116. homeDiagnose.setBehospitalType(rs.getString("behospitalType"));//入院情况
  117. homeDiagnose.setLeaveHospitalType(rs.getString("leaveHospitalType"));//出院情况
  118. // homeDiagnose.setPathologyDiagnose();//病理号
  119. homeDiagnose.setIcdCode(rs.getString("icdCode"));//诊断编码
  120. homeDiagnoseVOList.add(homeDiagnose);
  121. }
  122. } catch (Exception e) {
  123. e.printStackTrace();
  124. }finally {
  125. close();
  126. }
  127. return homeDiagnoseVOList;
  128. }
  129. /**
  130. * 病案手术
  131. * @return
  132. */
  133. public List<HomeOperationInfo> getHomeOperation(String sql) {
  134. List<HomeOperationInfo> homeOperationVOList=Lists.newLinkedList();
  135. try {
  136. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  137. ResultSet rs =dbconn.Query(sql, null);
  138. while(rs.next()){
  139. HomeOperationInfo homeOperationVO=new HomeOperationInfo();
  140. homeOperationVO.setHomePageId(rs.getString("homePageId"));//病案首页ID
  141. homeOperationVO.setHospitalId(rs.getLong("hospitalId"));//医院ID
  142. homeOperationVO.setOperationOrderNo(rs.getString("operationOrderNo"));//手术序号
  143. homeOperationVO.setOperationCode(rs.getString("operationCode"));//手术编码
  144. homeOperationVO.setOperationDoctorId(rs.getString("operationDoctorId"));//手术医生
  145. homeOperationVO.setFirstAssistantId(rs.getString("firstAssistantId"));//一助医生
  146. homeOperationVO.setSecondAssistantId(rs.getString("secondAssistantId"));//二助医生
  147. homeOperationVO.setCutLevel(rs.getString("cutLevel"));//切口等级
  148. homeOperationVO.setHealingLevel(rs.getString("healingLevel"));//愈合等级
  149. homeOperationVO.setOperationName(rs.getString("operationName"));//手术名称
  150. homeOperationVO.setOperationLevel(rs.getString("operationLevel"));//手术级别
  151. homeOperationVO.setAnaesthesiaName(rs.getString("anaesthesiaName"));//麻醉方式
  152. // homeOperationVO.setShamOperationName(rs.getString("shamOperationName"));//拟手术名称
  153. homeOperationVO.setAnaesthesiaDoctor(rs.getString("anaesthesiaDoctor"));//麻醉医师
  154. if (null!=rs.getString("operationDate")){
  155. homeOperationVO.setOperationDate(DateUtil.parseDate(rs.getString("operationDate"),DateUtil.DATE_TIME_FORMAT));//手术日期
  156. }
  157. homeOperationVOList.add(homeOperationVO);
  158. }
  159. } catch (Exception e) {
  160. e.printStackTrace();
  161. }finally {
  162. close();
  163. }
  164. List<HomeOperationInfo> homeOperationList=BeanUtil.listCopyTo(homeOperationVOList, HomeOperationInfo.class);
  165. return homeOperationList;
  166. }
  167. /**
  168. * 从视图获取病案首页信息
  169. */
  170. public List<HisHomePageVO> getHomePage(String sql) {
  171. List<HisHomePageVO> homePageList=Lists.newLinkedList();
  172. try {
  173. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  174. ResultSet rs =dbconn.Query(sql, null);
  175. while(rs.next()){
  176. HisHomePageVO hisHomePageVO =new HisHomePageVO();
  177. hisHomePageVO.setHomePageId(rs.getString("homePageId"));
  178. hisHomePageVO.setBehospitalCode(rs.getString("behospitalCode"));
  179. hisHomePageVO.setHospitalId(rs.getLong("hospitalId"));
  180. hisHomePageVO.setKeyCn(rs.getString("key_cn"));
  181. hisHomePageVO.setKeyEn(rs.getString("key_en"));
  182. hisHomePageVO.setDeValue(rs.getString("de_value"));
  183. homePageList.add(hisHomePageVO);
  184. }
  185. } catch (Exception e) {
  186. e.printStackTrace();
  187. }finally {
  188. close();
  189. }
  190. return homePageList;
  191. }
  192. public List<StructuralDataVo> getBehospitalInfoDate(String sql) {
  193. List<StructuralDataVo> strings=Lists.newLinkedList();
  194. try {
  195. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  196. ResultSet rs =dbconn.Query(sql, null);
  197. while(rs.next()){
  198. StructuralDataVo structuralDataVo =new StructuralDataVo();
  199. structuralDataVo.setBehospitalCode(rs.getString("behospitalCode"));//病人住院ID
  200. structuralDataVo.setPatientId(rs.getString("patientId"));
  201. strings.add(structuralDataVo);
  202. }
  203. } catch (Exception e) {
  204. e.printStackTrace();
  205. }finally {
  206. close();
  207. }
  208. return strings;
  209. }
  210. /**
  211. * 获取病人登录信息
  212. * @return
  213. */
  214. public List<BehospitalInfo> getBehospitalInfo(String sql) {
  215. List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
  216. try {
  217. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  218. ResultSet rs =dbconn.Query(sql, null);
  219. while(rs.next()){
  220. BehospitalInfo behospitalInfo=new BehospitalInfo();
  221. behospitalInfo.setBehospitalCode(rs.getString("behospitalCode"));//病人住院ID
  222. behospitalInfo.setHospitalId(rs.getLong("hospitalId"));//医院ID
  223. behospitalInfo.setName(rs.getString("name"));//姓名
  224. behospitalInfo.setSex(rs.getString("sex"));//性别
  225. behospitalInfo.setFileCode(rs.getString("fileCode"));//档案号
  226. behospitalInfo.setWardCode(rs.getString("wardCode"));//病区编码
  227. behospitalInfo.setWardName(rs.getString("wardName"));//病区名称
  228. behospitalInfo.setBehDeptId(rs.getString("behDeptId"));//住院科室ID
  229. behospitalInfo.setBehDeptName(rs.getString("behDeptName"));//住院科室名称
  230. behospitalInfo.setBedCode(rs.getString("bedCode"));//床位号
  231. behospitalInfo.setBedName(rs.getString("bedName"));//床位名称
  232. behospitalInfo.setInsuranceName(rs.getString("insuranceName"));//医保类别
  233. behospitalInfo.setJobType(rs.getString("jobType"));//职业
  234. behospitalInfo.setDiagnoseIcd(rs.getString("diagnoseIcd"));//疾病ICD编码
  235. behospitalInfo.setDiagnose(rs.getString("diagnose"));//疾病名称
  236. behospitalInfo.setBehDoctorId(rs.getString("behDoctorId"));//住院医生ID
  237. behospitalInfo.setBehDoctorName(rs.getString("behDoctorName"));//住院医生信息
  238. behospitalInfo.setDirectorDoctorId(rs.getString("directorDoctorId"));//主任医生ID
  239. behospitalInfo.setDirectorDoctorName(rs.getString("directorDoctorName"));//主任医生姓名
  240. behospitalInfo.setDoctorId(rs.getString("doctorId"));//医生ID
  241. behospitalInfo.setDoctorName(rs.getString("doctorName"));//医生姓名
  242. if (null!=rs.getString("behospitalDate")) {
  243. behospitalInfo.setBehospitalDate(DateUtil.parseDate(rs.getString("behospitalDate"),DateUtil.DATE_TIME_FORMAT));//入院时间
  244. }
  245. if (null!=rs.getString("leaveHospitalDate")) {
  246. behospitalInfo.setLeaveHospitalDate(DateUtil.parseDate(rs.getString("leaveHospitalDate"),DateUtil.DATE_FORMAT));//出院日期
  247. }
  248. if (null!=rs.getString("birthday")) {
  249. behospitalInfo.setBirthday(DateUtil.parseDate(rs.getString("birthday"),DateUtil.DATE_FORMAT));//出生日期
  250. }
  251. behospitalInfoList.add(behospitalInfo);
  252. }
  253. } catch (Exception e) {
  254. e.printStackTrace();
  255. }finally {
  256. close();
  257. }
  258. return behospitalInfoList;
  259. }
  260. /**
  261. * 从视图中获取医嘱信息
  262. * @return
  263. */
  264. public List<DoctorAdvice> getDoctorAdvice(String sql){
  265. List<DoctorAdvice> doctorAdviceList=Lists.newLinkedList();
  266. try {
  267. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  268. ResultSet rs =dbconn.Query(sql, null);
  269. while(rs.next()){
  270. DoctorAdvice doctorAdviceVO=new DoctorAdvice();
  271. doctorAdviceVO.setDoctorAdviceId(rs.getString("doctorAdviceId"));//病人医嘱ID
  272. doctorAdviceVO.setHospitalId(rs.getLong("hospitalId"));//医院ID
  273. doctorAdviceVO.setBehospitalCode(rs.getString("behospitalCode"));//病人ID
  274. doctorAdviceVO.setOrderDoctorName(rs.getString("orderDoctorName"));//医生开单判别
  275. doctorAdviceVO.setFrequency(rs.getString("frequency"));//医嘱频率判别
  276. doctorAdviceVO.setParentTypeId(rs.getString("parentTypeId"));//父类医嘱ID
  277. doctorAdviceVO.setDoctorAdviceType(rs.getString("doctorAdviceType"));//医嘱类型判别
  278. doctorAdviceVO.setDose(rs.getString("dose"));//医嘱单次剂量
  279. doctorAdviceVO.setDoseUnit(rs.getString("doseUnit"));//单次剂量单位
  280. doctorAdviceVO.setMedModeType(rs.getString("medModeType"));//给药方式
  281. doctorAdviceVO.setMedicineType(rs.getString("medicineType"));//药品类型
  282. doctorAdviceVO.setDaItemName(rs.getString("daItemName"));//医嘱项目名称
  283. doctorAdviceVO.setDoctorId(rs.getString("doctorId"));//开单医生ID
  284. doctorAdviceVO.setDoctorName(rs.getString("doctorName"));//开单医生姓名
  285. if (null!=rs.getString("daStartDate")) {
  286. doctorAdviceVO.setDaStartDate(DateUtil.parseDate(rs.getString("daStartDate"),DateUtil.DATE_TIME_FORMAT));//医嘱开始时间
  287. }
  288. if (null!=rs.getString("daStopDate")) {
  289. doctorAdviceVO.setDaStopDate(DateUtil.parseDate(rs.getString("daStopDate"),DateUtil.DATE_TIME_FORMAT));//医嘱结束时间
  290. }
  291. // doctorAdviceVO.setDaFrequency(rs.getString("daFrequency"));//医嘱频率
  292. // doctorAdviceVO.setDaDealType(rs.getString("daDealType"));//医嘱处理类型
  293. // doctorAdviceVO.setUsageNum(rs.getString("usageNum"));//一次使用数量
  294. // doctorAdviceVO.setUsageUnit(rs.getString("usageUnit"));//一次用量单位
  295. // doctorAdviceVO.setDaStatus(rs.getString("daStatus"));//医嘱状态判别
  296. // doctorAdviceVO.setDaGroupNo(rs.getString("daGroupNo"));//医嘱同组序号
  297. // doctorAdviceVO.setDaPrescriptionType(rs.getString("daPrescriptionType"));//医嘱处方类型
  298. // doctorAdviceVO.setDaMedType(rs.getString("daMedType"));//医嘱领药类型
  299. // doctorAdviceVO.setDoctorNotice(rs.getString("doctorNotice"));//医生嘱托
  300. doctorAdviceList.add(doctorAdviceVO);
  301. }
  302. } catch (Exception e) {
  303. e.printStackTrace();
  304. }finally {
  305. close();
  306. }
  307. return doctorAdviceList;
  308. }
  309. /**
  310. * 从视图中获取危急值信息
  311. * @return
  312. */
  313. public List<MedCrisisInfo> getMedCrisisInfo(String sql){
  314. List<MedCrisisInfo> medCrisisInfos=Lists.newLinkedList();
  315. try {
  316. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  317. ResultSet rs =dbconn.Query(sql, null);
  318. while(rs.next()){
  319. MedCrisisInfo medCrisisInfo=new MedCrisisInfo();
  320. medCrisisInfo.setRecId(rs.getString("recId"));
  321. medCrisisInfo.setHospitalId(rs.getLong("hospitalId"));//医院ID
  322. medCrisisInfo.setBehospitalCode(rs.getString("behospitalCode"));//病人住院ID
  323. medCrisisInfo.setRecType(rs.getString("recType"));//记录类型
  324. medCrisisInfo.setCrisisId(rs.getString("crisisId"));//危急值id
  325. medCrisisInfo.setDeptId(rs.getString("deptId"));//开单科室id
  326. medCrisisInfo.setDeptName(rs.getString("deptName"));//开单科室姓名
  327. medCrisisInfo.setDoctorId(rs.getString("doctorId"));//开单医生id
  328. medCrisisInfo.setDoctorName(rs.getString("doctorName"));//开单医生姓名
  329. medCrisisInfo.setCrisisValue(rs.getString("crisisValue"));//危急值结果
  330. medCrisisInfo.setCrisisDesc(rs.getString("crisisDesc"));//危急值描述
  331. medCrisisInfo.setCrisisLowerValue(rs.getString("crisisLowerValue"));//参考下限
  332. medCrisisInfo.setCrisisTopValue(rs.getString("crisisTopValue"));//参考上线
  333. if (null!=rs.getString("repDate")) {
  334. medCrisisInfo.setRepDate(DateUtil.parseDate(rs.getString("repDate"),DateUtil.DATE_TIME_FORMAT));//报告时间
  335. }
  336. medCrisisInfos.add(medCrisisInfo);
  337. }
  338. } catch (Exception e) {
  339. e.printStackTrace();
  340. }finally {
  341. close();
  342. }
  343. return medCrisisInfos;
  344. }
  345. /**
  346. * 从视图中获取同意书
  347. * @return
  348. */
  349. public List<StrInformedConsent> getStrInformedConsent(String sql){
  350. List<StrInformedConsent> strInformedConsents=Lists.newLinkedList();
  351. try {
  352. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  353. ResultSet rs =dbconn.Query(sql, null);
  354. while(rs.next()){
  355. StrInformedConsent strInformedConsent =new StrInformedConsent();
  356. strInformedConsent.setRecId(rs.getString("recId"));
  357. strInformedConsent.setHospitalId(rs.getLong("hospitalId"));
  358. strInformedConsent.setBehospitalCode(rs.getString("behospitalCode"));
  359. strInformedConsent.setRecTitle(rs.getString("recTitle"));
  360. strInformedConsent.setRecType(rs.getString("recType"));
  361. strInformedConsents.add(strInformedConsent);
  362. }
  363. } catch (Exception e) {
  364. e.printStackTrace();
  365. }finally {
  366. close();
  367. }
  368. return strInformedConsents;
  369. }
  370. /**
  371. * 从视图中获取告知书
  372. * @return
  373. */
  374. public List<StrTalkInform> getStrTalkInform(String sql){
  375. List<StrTalkInform> strTalkInforms=Lists.newLinkedList();
  376. try {
  377. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  378. ResultSet rs =dbconn.Query(sql, null);
  379. while(rs.next()){
  380. StrTalkInform strTalkInform =new StrTalkInform();
  381. strTalkInform.setRecId(rs.getString("recId"));
  382. strTalkInform.setHospitalId(rs.getLong("hospitalId"));
  383. strTalkInform.setBehospitalCode(rs.getString("behospitalCode"));
  384. strTalkInform.setRecTitle(rs.getString("recTitle"));
  385. strTalkInform.setRecType(rs.getString("recType"));
  386. strTalkInforms.add(strTalkInform);
  387. }
  388. } catch (Exception e) {
  389. e.printStackTrace();
  390. }finally {
  391. close();
  392. }
  393. return strTalkInforms;
  394. }
  395. /**
  396. * 从视图中获取化验
  397. * @return
  398. */
  399. public List<MedLisResult> getLisResult(String sql){
  400. List<MedLisResult> medLisResultList=Lists.newLinkedList();
  401. try {
  402. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  403. ResultSet rs =dbconn.Query(sql, null);
  404. while(rs.next()){
  405. MedLisResult medLisResult=new MedLisResult();
  406. medLisResult.setRepNo(rs.getString("recId"));//报告单号
  407. medLisResult.setHospitalId(rs.getLong("hospitalId"));
  408. medLisResult.setBehospitalCode(rs.getString("behospitalCode"));//住院病人id
  409. medLisResult.setItemCode(rs.getString("itemCode"));//报告代码
  410. medLisResult.setItemName(rs.getString("itemName"));//报告名称
  411. medLisResult.setResult(rs.getString("result"));//检验结果
  412. medLisResult.setReferenceMin(rs.getString("referenceMin"));//最小参考值
  413. medLisResult.setReferenceMax(rs.getString("referenceMax"));//最大参考值
  414. medLisResult.setUnit(rs.getString("unit"));//单位
  415. medLisResult.setAbnormal(rs.getString("abnormal"));//异常标志
  416. // medLisResult.setColor(rs.getString("color"));//异常颜色
  417. medLisResultList.add(medLisResult);
  418. }
  419. } catch (Exception e) {
  420. e.printStackTrace();
  421. }finally {
  422. close();
  423. }
  424. return medLisResultList;
  425. }
  426. /**
  427. * 从视图中获取检查
  428. * @return
  429. */
  430. public List<MedPacsResult> getPacsResult(String sql){
  431. List<MedPacsResult> medPacsResultList=Lists.newLinkedList();
  432. try {
  433. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  434. ResultSet rs =dbconn.Query(sql, null);
  435. while(rs.next()){
  436. MedPacsResult medPacsResult=new MedPacsResult();
  437. medPacsResult.setRepNo(rs.getString("recId"));//报告单号
  438. medPacsResult.setHospitalId(rs.getLong("hospitalId"));
  439. medPacsResult.setBehospitalCode(rs.getString("behospitalCode"));//住院病人ID
  440. medPacsResult.setReptName(rs.getString("reptName"));//报告名称
  441. medPacsResult.setPart(rs.getString("part"));//检查部位
  442. medPacsResult.setClinicSight(rs.getString("clinicSight"));//检查所见
  443. medPacsResult.setReptDiag(rs.getString("reptDiag"));//检查结果
  444. // medPacsResult.setRemark(rs.getString("remark"));//观察记录
  445. // medPacsResult.setClinicDiag(rs.getString("clinicDiag"));//临床诊断
  446. medPacsResult.setApplyDoctor(rs.getString("applyDoctor"));//申请医生
  447. medPacsResult.setCheckerDoctor(rs.getString("checkerDoctor"));//审核医生
  448. medPacsResult.setReportDoctor(rs.getString("reportDoctor"));//报告医生
  449. medPacsResult.setDeptName(rs.getString("deptName"));//科室名称
  450. medPacsResultList.add(medPacsResult);
  451. }
  452. } catch (Exception e) {
  453. e.printStackTrace();
  454. }finally {
  455. close();
  456. }
  457. return medPacsResultList;
  458. }
  459. /**
  460. * 从视图中获取检查
  461. * @return
  462. */
  463. public List<MedLisInfo> getLisInfo(String sql){
  464. List<MedLisInfo> medLisInfos=Lists.newLinkedList();
  465. try {
  466. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  467. ResultSet rs =dbconn.Query(sql, null);
  468. while(rs.next()){
  469. MedLisInfo medLisInfo=new MedLisInfo();
  470. medLisInfo.setRepNo(rs.getString("recId"));
  471. medLisInfo.setHospitalId(String.valueOf(rs.getLong("hospitalId")));
  472. medLisInfo.setBehospitalCode(rs.getString("behospitalCode"));
  473. medLisInfo.setRepName(rs.getString("repName"));
  474. medLisInfo.setRepType(rs.getString("repType"));
  475. medLisInfo.setRepTypeName(rs.getString("repTypeName"));
  476. medLisInfo.setSlideType(rs.getString("slideType"));
  477. medLisInfo.setRepDate(rs.getString("repDate"));
  478. medLisInfo.setCheckDate(rs.getString("checkDate"));
  479. medLisInfo.setApplyDoctor(rs.getString("applyDoctor"));
  480. medLisInfos.add(medLisInfo);
  481. }
  482. } catch (Exception e) {
  483. e.printStackTrace();
  484. }finally {
  485. close();
  486. }
  487. return medLisInfos;
  488. }
  489. public List<MedPacsInfo> getPacsInfo(String sql){
  490. List<MedPacsInfo> medPacsInfos=Lists.newLinkedList();
  491. try {
  492. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  493. ResultSet rs =dbconn.Query(sql, null);
  494. while(rs.next()){
  495. MedPacsInfo medPacsInfo=new MedPacsInfo();
  496. medPacsInfo.setRepNo(rs.getString("recId"));
  497. medPacsInfo.setHospitalId(String.valueOf(rs.getLong("hospitalId")));
  498. medPacsInfo.setBehospitalCode(rs.getString("behospitalCode"));
  499. medPacsInfo.setRepName(rs.getString("repName"));
  500. medPacsInfo.setRepType(rs.getString("repType"));
  501. medPacsInfo.setRepTypeName(rs.getString("repTypeName"));
  502. medPacsInfo.setPart(rs.getString("part"));
  503. medPacsInfo.setRepDate(rs.getString("repDate"));
  504. medPacsInfo.setCheckDate(rs.getString("checkDate"));
  505. medPacsInfo.setApplyDoctor(rs.getString("applyDoctor"));
  506. medPacsInfos.add(medPacsInfo);
  507. }
  508. } catch (Exception e) {
  509. e.printStackTrace();
  510. }finally {
  511. close();
  512. }
  513. return medPacsInfos;
  514. }
  515. /**
  516. * 从视图中获取入院记录
  517. * @param sql
  518. * @return
  519. */
  520. public List<FJStrAdmissionNoteVo> getMedAdmissionNote(String sql){
  521. List<FJStrAdmissionNoteVo> strAdmissionNoteVos=Lists.newLinkedList();
  522. try {
  523. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  524. ResultSet rs =dbconn.Query(sql, null);
  525. while(rs.next()){
  526. FJStrAdmissionNoteVo strAdmissionNoteVo=new FJStrAdmissionNoteVo();
  527. strAdmissionNoteVo.setRecId(rs.getString("recId"));//记录编号
  528. strAdmissionNoteVo.setHospitalId(rs.getLong("hospitalId"));//医院ID
  529. strAdmissionNoteVo.setBehospitalCode(rs.getString("behospitalCode"));//病历号
  530. strAdmissionNoteVo.setName(rs.getString("name"));//姓名
  531. strAdmissionNoteVo.setSex(rs.getString("sex"));//性别
  532. strAdmissionNoteVo.setAge(rs.getString("age"));//年龄
  533. strAdmissionNoteVo.setBedNo(rs.getString("bedNo"));//床号
  534. strAdmissionNoteVo.setDeptName(rs.getString("deptName"));//科别
  535. strAdmissionNoteVo.setRecTitle(rs.getString("recTitle"));//标题
  536. strAdmissionNoteVo.setMarriage(rs.getString("marriage"));//婚姻状况
  537. strAdmissionNoteVo.setJobType(rs.getString("jobType"));//职业
  538. strAdmissionNoteVo.setNation(rs.getString("nation"));//民族
  539. strAdmissionNoteVo.setPhone(rs.getString("phone"));//联系电话
  540. strAdmissionNoteVo.setWorkplace(rs.getString("workplace"));//工作单位
  541. strAdmissionNoteVo.setRegisterAddress(rs.getString("registerAddress"));//户口地址
  542. strAdmissionNoteVo.setBornAddress(rs.getString("bornAddress"));//出生地
  543. strAdmissionNoteVo.setHistoryTeller(rs.getString("historyTeller"));//病例陈述者
  544. strAdmissionNoteVo.setRecDoctor(rs.getString("recDoctor"));//记录医生
  545. strAdmissionNoteVo.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
  546. strAdmissionNoteVo.setKeyEn(rs.getString("key_en"));
  547. strAdmissionNoteVo.setKeyCN(rs.getString("key_cn"));
  548. strAdmissionNoteVo.setDeValue(rs.getString("de_value"));
  549. if(null!=(rs.getString("recDate"))) {
  550. strAdmissionNoteVo.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
  551. }
  552. if (null!=rs.getString("behospitalDate")){
  553. strAdmissionNoteVo.setBehospitalDate(DateUtil.parseDate(rs.getString("behospitalDate"),DateUtil.DATE_TIME_FORMAT));//病历日期
  554. }
  555. if(null!=(rs.getString("auditDate"))) {
  556. strAdmissionNoteVo.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
  557. }
  558. if (null!=rs.getString("birthday")){
  559. strAdmissionNoteVo.setBirthday(DateUtil.parseDate(rs.getString("birthday"),DateUtil.DATE_FORMAT));//病历日期
  560. }
  561. if (null!=rs.getString("recordDate")){
  562. strAdmissionNoteVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//病历日期
  563. }
  564. strAdmissionNoteVos.add(strAdmissionNoteVo);
  565. }
  566. } catch (Exception e) {
  567. e.printStackTrace();
  568. }finally {
  569. close();
  570. }
  571. return strAdmissionNoteVos;
  572. }
  573. /**
  574. * 从视图中获取危急值记录
  575. * @param sql
  576. * @return
  577. */
  578. public List<AStrCrisisNoteVO> getMedCrisisNote(String sql){
  579. List<AStrCrisisNoteVO> medCrisisNotes=Lists.newLinkedList();
  580. try {
  581. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  582. ResultSet rs =dbconn.Query(sql, null);
  583. while(rs.next()){
  584. AStrCrisisNoteVO medCrisisNote=new AStrCrisisNoteVO();
  585. medCrisisNote.setRecId(rs.getString("recId"));//记录编号
  586. medCrisisNote.setHospitalId(String.valueOf(rs.getLong("hospitalId")));//医院ID
  587. medCrisisNote.setBehospitalCode(rs.getString("behospitalCode"));//病历号
  588. medCrisisNote.setName(rs.getString("name"));//姓名
  589. medCrisisNote.setSex(rs.getString("sex"));//性别
  590. medCrisisNote.setAge(rs.getString("age"));//年龄
  591. medCrisisNote.setBedNo(rs.getString("bedNo"));//床号
  592. medCrisisNote.setDeptName(rs.getString("deptName"));//科别
  593. medCrisisNote.setRecTitle(rs.getString("recTitle"));//标题
  594. medCrisisNote.setCrisisNote(rs.getString("crisisNote"));//危急值报告
  595. medCrisisNote.setBriefNote(rs.getString("briefNote"));//病情分析及处理
  596. medCrisisNote.setRecordDate(rs.getString("recordDate"));
  597. medCrisisNote.setRecieveDate(rs.getString("recieveDate"));
  598. // medCrisisNote.setRecDoctor(rs.getString("recDoctor"));//记录医生
  599. // medCrisisNote.setRecDate(rs.getDate("recDate"));//记录时间
  600. // medCrisisNote.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
  601. // medCrisisNote.setAuditDate(rs.getDate("auditDate"));//审核时间
  602. // medCrisisNote.setWholeData(rs.getString("wholeData"));//结构化数据
  603. // medCrisisNote.setRemark(rs.getString(""));//备注
  604. medCrisisNotes.add(medCrisisNote);
  605. }
  606. } catch (Exception e) {
  607. e.printStackTrace();
  608. }finally {
  609. close();
  610. }
  611. return medCrisisNotes;
  612. }
  613. /**
  614. * 从视图中获取查房记录
  615. * @param sql
  616. * @return
  617. */
  618. public List<StrWardRecord> getMedWardRecord(String sql){
  619. List<StrWardRecord> medWardRecords=Lists.newLinkedList();
  620. try {
  621. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  622. ResultSet rs =dbconn.Query(sql, null);
  623. while(rs.next()){
  624. StrWardRecord medWardRecord=new StrWardRecord();
  625. medWardRecord.setRecId(rs.getString("recId"));//记录编号
  626. medWardRecord.setHospitalId(rs.getLong("hospitalId"));//医院ID
  627. medWardRecord.setBehospitalCode(rs.getString("behospitalCode"));//病历号
  628. medWardRecord.setName(rs.getString("name"));//姓名
  629. medWardRecord.setSex(rs.getString("sex"));//性别
  630. medWardRecord.setAge(rs.getString("age"));//年龄
  631. medWardRecord.setBedNo(rs.getString("bedNo"));//床号
  632. medWardRecord.setDeptName(rs.getString("deptName"));//科别
  633. medWardRecord.setWardDoctor(rs.getString("wardDoctor"));//查房医生
  634. medWardRecord.setWardTitle(rs.getString("wardTitle"));//标题
  635. medWardRecord.setWardContent(rs.getString("wardContent"));//病情记录
  636. medWardRecord.setWardA(rs.getString("wardS"));// A
  637. medWardRecord.setWardS(rs.getString("wardO"));// S
  638. medWardRecord.setWardO(rs.getString("wardA"));// O
  639. medWardRecord.setWardP(rs.getString("wardP"));// P
  640. medWardRecord.setRecDoctor(rs.getString("recDoctor"));//记录医生
  641. medWardRecord.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
  642. if(null!=(rs.getString("recDate"))) {
  643. medWardRecord.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
  644. }
  645. if(null!=(rs.getString("auditDate"))) {
  646. medWardRecord.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//审核时间
  647. }
  648. if (null!=rs.getString("recordDate")){
  649. medWardRecord.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//病历日期
  650. }
  651. if (null!=rs.getString("wardDate")){
  652. medWardRecord.setWardDate(DateUtil.parseDate(rs.getString("wardDate"),DateUtil.DATE_TIME_FORMAT));//查房日期
  653. }
  654. medWardRecords.add(medWardRecord);
  655. }
  656. } catch (Exception e) {
  657. e.printStackTrace();
  658. }finally {
  659. close();
  660. }
  661. return medWardRecords;
  662. }
  663. /**
  664. * 从视图中获取死亡病例讨论记录
  665. * @param sql
  666. * @return
  667. */
  668. public List<HisViewVo> getMedDeathDiscussion(String sql){
  669. List<HisViewVo> hisViewVos=Lists.newLinkedList();
  670. try {
  671. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  672. ResultSet rs =dbconn.Query(sql, null);
  673. while(rs.next()){
  674. HisViewVo hisViewVo=new HisViewVo();
  675. hisViewVo.setRecId(rs.getString("recId"));//记录编号
  676. hisViewVo.setHospitalId(rs.getLong("hospitalId"));//医院ID
  677. hisViewVo.setBehospitalCode(rs.getString("behospitalCode"));//病历号
  678. hisViewVo.setName(rs.getString("name"));//姓名
  679. hisViewVo.setSex(rs.getString("sex"));//性别
  680. hisViewVo.setAge(rs.getString("age"));//年龄
  681. hisViewVo.setBedNo(rs.getString("bedNo"));//床号
  682. hisViewVo.setDeptName(rs.getString("deptName"));//科别
  683. hisViewVo.setRecTitle(rs.getString("recTitle"));//标题
  684. hisViewVo.setRecDoctor(rs.getString("recDoctor"));//记录医生
  685. hisViewVo.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
  686. hisViewVo.setContentText(rs.getString("contentText"));//文本
  687. hisViewVo.setContentText1(rs.getString("contentText1"));//文本1
  688. hisViewVo.setContentText2(rs.getString("contentText2"));//文本2
  689. hisViewVo.setKeyEn(rs.getString("key_en"));//字段英文名
  690. hisViewVo.setKeyCN(rs.getString("key_cn"));//字段中文名
  691. hisViewVo.setDeValue1(rs.getString("de_value1"));//字段值1
  692. hisViewVo.setDeValue2(rs.getString("de_value2"));//字段值2
  693. if(null!=(rs.getString("deathDate"))){
  694. hisViewVo.setDeathDate(DateUtil.parseDate(rs.getString("deathDate"),DateUtil.DATE_TIME_FORMAT));//死亡时间
  695. }
  696. if(null!=(rs.getString("recordDate"))){
  697. hisViewVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//质控日期
  698. }
  699. if(null!=(rs.getString("auditDate"))) {
  700. hisViewVo.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//审核时间
  701. }
  702. if(null!=(rs.getString("recDate"))) {
  703. hisViewVo.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
  704. }
  705. hisViewVos.add(hisViewVo);
  706. }
  707. } catch (Exception e) {
  708. e.printStackTrace();
  709. }finally {
  710. close();
  711. }
  712. return hisViewVos;
  713. }
  714. /**
  715. * 从视图中获取死亡记录
  716. * @param sql
  717. * @return
  718. */
  719. public List<StrDeathNote> getMedDeathNote(String sql){
  720. List<StrDeathNote> medDeathNotes=Lists.newLinkedList();
  721. try {
  722. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  723. ResultSet rs =dbconn.Query(sql, null);
  724. while(rs.next()){
  725. StrDeathNote medDeathNote=new StrDeathNote();
  726. medDeathNote.setRecId(rs.getString("recId"));//记录编号
  727. medDeathNote.setHospitalId(HOSPITAL_ID);//医院ID
  728. medDeathNote.setBehospitalCode(rs.getString("behospitalCode"));//病历号
  729. medDeathNote.setName(rs.getString("name"));//姓名
  730. medDeathNote.setSex(rs.getString("sex"));//性别
  731. medDeathNote.setAge(rs.getString("age"));//年龄
  732. medDeathNote.setBedNo(rs.getString("bedNo"));//床号
  733. medDeathNote.setDeptName(rs.getString("deptName"));//科别
  734. medDeathNote.setRecordDate(rs.getDate("recordDate"));//病历日期
  735. medDeathNote.setRecTitle(rs.getString("recTitle"));//标题
  736. medDeathNote.setBehospitalDate(rs.getDate("behospitalDate"));//入院日期
  737. medDeathNote.setDeathDate(rs.getDate("deathDate"));//死亡日期
  738. medDeathNote.setBehospitalSituation(rs.getString("behospitalSituation"));//入院情况
  739. medDeathNote.setTentativeDiagnosis(rs.getString("tentativeDiagnosis"));//入院诊断
  740. medDeathNote.setTreatmentProcess(rs.getString("treatmentProcess"));//诊疗经过
  741. medDeathNote.setDeathReason(rs.getString("deathReason"));//死亡原因
  742. medDeathNote.setDeathDiagnosis(rs.getString("deathDiagnosis"));//死亡诊断
  743. medDeathNote.setRecDoctor(rs.getString("recDoctor"));//记录医生
  744. medDeathNote.setRecDate(rs.getDate("recDate"));//记录时间
  745. medDeathNote.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
  746. medDeathNote.setAuditDate(rs.getDate("auditDate"));//审核时间
  747. medDeathNote.setWholeData(rs.getString("wholeData"));//结构化数据
  748. medDeathNote.setRemark(rs.getString(""));//备注
  749. medDeathNotes.add(medDeathNote);
  750. }
  751. } catch (Exception e) {
  752. e.printStackTrace();
  753. }finally {
  754. close();
  755. }
  756. return medDeathNotes;
  757. }
  758. /**
  759. * 从视图中获取文书数据
  760. * @param sql
  761. * @return
  762. */
  763. public List<HisViewVo> getHisView(String sql){
  764. List<HisViewVo> hisViewVos=Lists.newLinkedList();
  765. try {
  766. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  767. ResultSet rs =dbconn.Query(sql, null);
  768. while(rs.next()){
  769. HisViewVo hisViewVo=new HisViewVo();
  770. hisViewVo.setRecId(rs.getString("recId"));//记录编号
  771. hisViewVo.setHospitalId(rs.getLong("hospitalId"));//医院ID
  772. hisViewVo.setBehospitalCode(rs.getString("behospitalCode"));//病历号
  773. hisViewVo.setName(rs.getString("name"));//姓名
  774. hisViewVo.setSex(rs.getString("sex"));//性别
  775. hisViewVo.setAge(rs.getString("age"));//年龄
  776. hisViewVo.setBedNo(rs.getString("bedNo"));//床号
  777. hisViewVo.setDeptName(rs.getString("deptName"));//科别
  778. hisViewVo.setRecTitle(rs.getString("recTitle"));//标题
  779. hisViewVo.setRecDoctor(rs.getString("recDoctor"));//记录医生
  780. hisViewVo.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
  781. hisViewVo.setContentText(rs.getString("contentText"));//文本
  782. hisViewVo.setContentText1(rs.getString("contentText1"));//文本1
  783. hisViewVo.setContentText2(rs.getString("contentText2"));//文本2
  784. hisViewVo.setKeyEn(rs.getString("key_en"));//字段英文名
  785. hisViewVo.setKeyCN(rs.getString("key_cn"));//字段中文名
  786. hisViewVo.setDeValue(rs.getString("de_value"));//字段值
  787. if(null!=(rs.getString("recordDate"))){
  788. hisViewVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//质控日期
  789. }
  790. if(null!=(rs.getString("auditDate"))) {
  791. hisViewVo.setAuditDate(DateUtil.parseDate(rs.getString("auditDate"),DateUtil.DATE_TIME_FORMAT));//审核时间
  792. }
  793. if(null!=(rs.getString("recDate"))) {
  794. hisViewVo.setRecDate(DateUtil.parseDate(rs.getString("recDate"),DateUtil.DATE_TIME_FORMAT));//记录时间
  795. }
  796. hisViewVos.add(hisViewVo);
  797. }
  798. } catch (Exception e) {
  799. e.printStackTrace();
  800. }finally {
  801. close();
  802. }
  803. return hisViewVos;
  804. }
  805. /**
  806. * 获取操作的名称
  807. * @param sql
  808. * @return
  809. */
  810. public List<String> getOpsName(String sql){
  811. List<String> names =new ArrayList<>();
  812. try {
  813. FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
  814. ResultSet rs =dbconn.Query(sql, null);
  815. while(rs.next()){
  816. String name =rs.getString("icd_name");
  817. names.add(name);
  818. }
  819. } catch (Exception e) {
  820. e.printStackTrace();
  821. }finally {
  822. close();
  823. }
  824. return names;
  825. }
  826. }