Commit 182f50e227a30992db5b5281637dca081c2bc296

Authored by yangfei
1 parent 0a3cde6891

开通VIP增值服务

Showing 2 changed files with 28 additions and 8 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyHisService.java View file @ 182f50e
... ... @@ -20,11 +20,11 @@
20 20 */
21 21 @Service("llfyHisService")
22 22 public class LlfyHisService {
23   - public List<Map<String,Object>> getPatientInfo(Patients ps,String startDate,String endDate) {
  23 + public List<Map<String,String>> getPatientInfo(Patients ps,String startDate,String endDate) {
24 24 Connection conn = com.lyms.hospitalapi.llfy.ConnTools.makeHisConnection();
25 25 QueryRunner queryRunner = new QueryRunner();
26   - List<Map<String,Object>> resultList = new ArrayList<>();
27   - Map<String,Object> map = new HashedMap();
  26 + List<Map<String,String>> resultList = new ArrayList<>();
  27 + Map<String,String> map = new HashedMap();
28 28 try {
29 29 List<LcfyPatient> 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>(LcfyPatient.class));
30 30 if(CollectionUtils.isNotEmpty(list)){
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java View file @ 182f50e
... ... @@ -334,14 +334,29 @@
334 334 public void synUpdateHisData(PatientMarkHospital ps){
335 335 Patients patients = patientsService.findOnePatientById(ps.getPatientId());
336 336 if (null != patients) {
337   - List<Map<String,Object>> makePatients = llfyHisService.getPatientInfo(patients,DateUtil.getyyyy_MM_dd(ps.getMakeDate()),DateUtil.getyyyy_MM_dd(new Date()));
338   - if(ps.getHospitType()==null){
339   -
  337 + List<Map<String,String>> makePatients = llfyHisService.getPatientInfo(patients,DateUtil.getyyyy_MM_dd(ps.getMakeDate()),DateUtil.getyyyy_MM_dd(new Date()));
  338 + if(CollectionUtils.isNotEmpty(makePatients)){
  339 + for(Map<String,String> map : makePatients){
  340 + String inHospDiagn = map.get("inHospDiagn");
  341 + int hospType = getHospitType(inHospDiagn);
  342 + ps.setHospitStatus(2);
  343 + if(ps.getHospitStatus()==null){
  344 + ps.setHospitType(hospType);
  345 + }else if(hospType==1){//当住院方式为分娩方式时
  346 + ps.setHospitType(hospType);
  347 + }
  348 + }
  349 + patientMarkHospitalService.updatePatientMarkHospital(ps);
340 350 }
341 351 }
342 352 }
343 353  
344   - public static Map<String, Integer> initHospitType() {
  354 + /**
  355 + * 根据入院诊断返回入院方式
  356 + * @param intHospDesc 入院诊断编码
  357 + * @return
  358 + */
  359 + public static int getHospitType(String intHospDesc) {
345 360 Map<String, Integer> map = new HashMap<>();
346 361 map.put("00001", 1);
347 362 map.put("00002", 1);
... ... @@ -426,7 +441,12 @@
426 441 map.put("yswr", 1);
427 442 map.put("ysydwr", 1);
428 443 map.put("zyxye", 1);
429   - return map;
  444 + Integer hospType = map.get(intHospDesc);
  445 + if(hospType==null){
  446 + return 2;
  447 + }else {
  448 + return 1;
  449 + }
430 450 }
431 451  
432 452 }