From 182f50e227a30992db5b5281637dca081c2bc296 Mon Sep 17 00:00:00 2001 From: yangfei Date: Mon, 18 Sep 2017 17:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E9=80=9AVIP=E5=A2=9E=E5=80=BC?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/hospitalapi/llfy/LlfyHisService.java | 6 ++--- .../web/facade/PatientMarkHospServiceFacade.java | 30 ++++++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyHisService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyHisService.java index 12013ea..3e2df97 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyHisService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyHisService.java @@ -20,11 +20,11 @@ import java.util.Map; */ @Service("llfyHisService") public class LlfyHisService { - public List> getPatientInfo(Patients ps,String startDate,String endDate) { + public List> getPatientInfo(Patients ps,String startDate,String endDate) { Connection conn = com.lyms.hospitalapi.llfy.ConnTools.makeHisConnection(); QueryRunner queryRunner = new QueryRunner(); - List> resultList = new ArrayList<>(); - Map map = new HashedMap(); + List> resultList = new ArrayList<>(); + Map map = new HashedMap(); try { List list = queryRunner.query(conn, "select 入院日期 as inHospDate,入院诊断 as inHospDiagn from fvw_住院病人档案 where (姓名= '"+ps.getUsername()+"' and 证件号 ='"+ps.getCardNo()+"') or (姓名='"+ps.getUsername()+"' and 手机号 ='"+ps.getPhone()+"') or (姓名='"+ps.getUsername()+"' and 就诊卡='"+ps.getVcCardNo()+"') and 入院日期 is not null and 入院日期 between '"+startDate+"' and '"+endDate+"'", new BeanListHandler(LcfyPatient.class)); if(CollectionUtils.isNotEmpty(list)){ diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java index a212aeb..8ad06c8 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java @@ -334,14 +334,29 @@ public class PatientMarkHospServiceFacade { public void synUpdateHisData(PatientMarkHospital ps){ Patients patients = patientsService.findOnePatientById(ps.getPatientId()); if (null != patients) { - List> makePatients = llfyHisService.getPatientInfo(patients,DateUtil.getyyyy_MM_dd(ps.getMakeDate()),DateUtil.getyyyy_MM_dd(new Date())); - if(ps.getHospitType()==null){ - + List> makePatients = llfyHisService.getPatientInfo(patients,DateUtil.getyyyy_MM_dd(ps.getMakeDate()),DateUtil.getyyyy_MM_dd(new Date())); + if(CollectionUtils.isNotEmpty(makePatients)){ + for(Map map : makePatients){ + String inHospDiagn = map.get("inHospDiagn"); + int hospType = getHospitType(inHospDiagn); + ps.setHospitStatus(2); + if(ps.getHospitStatus()==null){ + ps.setHospitType(hospType); + }else if(hospType==1){//当住院方式为分娩方式时 + ps.setHospitType(hospType); + } + } + patientMarkHospitalService.updatePatientMarkHospital(ps); } } } - public static Map initHospitType() { + /** + * 根据入院诊断返回入院方式 + * @param intHospDesc 入院诊断编码 + * @return + */ + public static int getHospitType(String intHospDesc) { Map map = new HashMap<>(); map.put("00001", 1); map.put("00002", 1); @@ -426,7 +441,12 @@ public class PatientMarkHospServiceFacade { map.put("yswr", 1); map.put("ysydwr", 1); map.put("zyxye", 1); - return map; + Integer hospType = map.get(intHospDesc); + if(hospType==null){ + return 2; + }else { + return 1; + } } } -- 1.8.3.1