| 
															
																@ -266,7 +266,7 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public JSONArray findTnYpxx(String ypdm,String ypmc,String kusl,String pydm ,String hisCode) throws Exception { 
															 | 
															
															 | 
															
																    public JSONArray findTnYpxx(String ypdm,String ypmc,String kusl,String pydm ,String hisCode) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String sql ="SELECT yp.YPXH,yp.XTSB,yp.YPMC,yp.YPGG,yp.YFGG,yp.BFGG,yp.YPSX,yp.TSYP,yp.YPDW,yp.ZXDW,yp.ZXBZ,yp.YFBZ,yp.YFDW,yp.BFBZ," + 
															 | 
															
															 | 
															
																        String sql ="SELECT yp.YPXH,yp.XTSB,yp.YPMC,yp.YPGG,yp.YFGG,yp.BFGG,yp.YPSX,yp.TSYP,yp.YPDW,yp.ZXDW,yp.ZXBZ,yp.YFBZ,yp.YFDW,yp.BFBZ," + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "yp.BFDW,yp.ZFPB,yp.YLXZ,yp.FYFS,yp.PYDM,yp.YPBH,yp.MESS,yp.GYFF,yp.TYPE,yp.YPDM,yp.YPJL,yp.JLDW,yp.YKZF,yp.YFZF,yp.ZXCD,yp.YCYL," + 
															 | 
															
															 | 
															
																                "yp.BFDW,yp.ZFPB,yp.YLXZ,yp.FYFS,yp.PYDM,yp.YPBH,yp.MESS,yp.GYFF,yp.TYPE,yp.YPDM,yp.YPJL,yp.JLDW,yp.YKZF,yp.YFZF,yp.ZXCD,yp.YCYL," + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "kc.YPCD,kc.LSJG,kc.KCSL,kc.BZLJ,yp.UNITCODE,yp.UNITCODENAME  FROM  YK_TYPK yp,YK_KCMX kc where 1=1 and kc.YPXH=yp.YPXH "; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                "kc.YPCD,kc.LSJG,kc.KCSL,kc.BZLJ,yp.UNITCODE,yp.UNTCODENAME  FROM  YK_TYPK yp,YK_KCMX kc where 1=1 and kc.YPXH=yp.YPXH "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (StringUtils.isNoneBlank(ypdm)){ 
															 | 
															
															 | 
															
																        if (StringUtils.isNoneBlank(ypdm)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            sql+=" and lower(YPDM) like '%"+ypdm.toLowerCase()+"%' "; 
															 | 
															
															 | 
															
																            sql+=" and lower(YPDM) like '%"+ypdm.toLowerCase()+"%' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -509,8 +509,8 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                wlyyOutpatientVO.setIcd10Name(icdName); 
															 | 
															
															 | 
															
																                wlyyOutpatientVO.setIcd10Name(icdName); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                String admDate = null == jsonObjectMgsInfo.get("KSSJ") ? "" : jsonObjectMgsInfo.get("KSSJ") + ""; 
															 | 
															
															 | 
															
																                String admDate = null == jsonObjectMgsInfo.get("KSSJ") ? "" : jsonObjectMgsInfo.get("KSSJ") + ""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                String conDate = null == jsonObjectMgsInfo.get("KSSJ") ? "" : jsonObjectMgsInfo.get("KSSJ") + ""; 
															 | 
															
															 | 
															
																                String conDate = null == jsonObjectMgsInfo.get("KSSJ") ? "" : jsonObjectMgsInfo.get("KSSJ") + ""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                wlyyOutpatientVO.setAdmDate(DateUtil.strToDate(admDate, DateUtil.YYYY_MM_DD_HH_MM_SS_)); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                wlyyOutpatientVO.setConDate(DateUtil.strToDate(conDate, DateUtil.YYYY_MM_DD_HH_MM_SS_)); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                wlyyOutpatientVO.setAdmDate(DateUtil.stampToDate(admDate)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                wlyyOutpatientVO.setConDate(DateUtil.stampToDate(admDate)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                List<WlyyInspectionVO> inspectionVOList = new ArrayList<>(); 
															 | 
															
															 | 
															
																                List<WlyyInspectionVO> inspectionVOList = new ArrayList<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                /*JSONArray array = findV_ZKSG_JCCX(PAT_NO,wlyyOutpatientVO.getAdmNo(),demoFlag); 
															 | 
															
															 | 
															
																                /*JSONArray array = findV_ZKSG_JCCX(PAT_NO,wlyyOutpatientVO.getAdmNo(),demoFlag); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                for (int j=0;j<array.size();j++){ 
															 | 
															
															 | 
															
																                for (int j=0;j<array.size();j++){ 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -701,13 +701,17 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @return 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @throws Exception 
															 | 
															
															 | 
															
																     * @throws Exception 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public JSONArray selectMzRecord(String doctor) throws Exception { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public JSONArray selectMzRecord(String doctor,String patientName) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor); 
															 | 
															
															 | 
															
																        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String condition = ""; 
															 | 
															
															 | 
															
																        String condition = ""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (doctorMappingDO!=null){ 
															 | 
															
															 | 
															
																        if (doctorMappingDO!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            condition = " and mz.YSDM ='"+doctorMappingDO.getMappingCode()+"' "; 
															 | 
															
															 | 
															
																            condition = " and mz.YSDM ='"+doctorMappingDO.getMappingCode()+"' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT mz.BRBH FROM YS_MZ_JZLS mz where 1=1 "+condition+" GROUP BY mz.BRBH ) and br.SFZH is not null and br.BRXM !='作废' "; 
															 | 
															
															 | 
															
																        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT mz.BRBH FROM YS_MZ_JZLS mz where 1=1 "+condition+" GROUP BY mz.BRBH ) and br.SFZH is not null and br.BRXM !='作废' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (StringUtils.isNoneBlank(patientName)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            sql+=" and br.BRXM like '%"+patientName+"%'"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
															
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("sql",sql); 
															 | 
															
															 | 
															
																        params.put("sql",sql); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("selectMzRecord:"+sql); 
															 | 
															
															 | 
															
																        logger.info("selectMzRecord:"+sql); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -717,11 +721,23 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject rs = JSON.parseObject(content); 
															 | 
															
															 | 
															
																        JSONObject rs = JSON.parseObject(content); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Integer status = rs.getInteger("status"); 
															 | 
															
															 | 
															
																        Integer status = rs.getInteger("status"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONArray array = new JSONArray(); 
															 | 
															
															 | 
															
																        JSONArray array = new JSONArray(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        JSONArray array1 = new JSONArray(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(status!=null&&status == 200){ 
															 | 
															
															 | 
															
																        if(status!=null&&status == 200){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            array = rs.getJSONArray("detailModelList"); 
															 | 
															
															 | 
															
																            array = rs.getJSONArray("detailModelList"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            for (int i = 0;i<array.size();i++){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                JSONObject jsonObject = JSONObject.parseObject(array.get(i).toString()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if (jsonObject.get("SFZH")!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    String szfh = jsonObject.getString("SFZH"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    jsonObject.put("sex",IdCardUtil.getSexForIdcard(szfh)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    jsonObject.put("age",IdCardUtil.getAgeForIdcard(szfh)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                array1.add(jsonObject); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            logger.info("selectMzRecord size:"+array.size()); 
															 | 
															
															 | 
															
																            logger.info("selectMzRecord size:"+array.size()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return array; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return array1; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -730,7 +746,7 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @return 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @throws Exception 
															 | 
															
															 | 
															
																     * @throws Exception 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public JSONArray selectZyRecord(String doctor) throws Exception { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public JSONArray selectZyRecord(String doctor,String patientName) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor); 
															 | 
															
															 | 
															
																        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String condition = ""; 
															 | 
															
															 | 
															
																        String condition = ""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (doctorMappingDO!=null){ 
															 | 
															
															 | 
															
																        if (doctorMappingDO!=null){ 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -739,6 +755,9 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            return null; 
															 | 
															
															 | 
															
																            return null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay ,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT cast(brry.BAHM as numeric(18,0)) FROM ZY_BRRY brry where 1=1 and isnumeric(brry.BAHM) = 1 "+condition+" GROUP BY brry.BAHM) and br.BRXM !='作废' and br.SFZH is not null "; 
															 | 
															
															 | 
															
																        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay ,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT cast(brry.BAHM as numeric(18,0)) FROM ZY_BRRY brry where 1=1 and isnumeric(brry.BAHM) = 1 "+condition+" GROUP BY brry.BAHM) and br.BRXM !='作废' and br.SFZH is not null "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (StringUtils.isNoneBlank(patientName)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            sql+=" and br.BRXM like '%"+patientName+"%' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
															
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("sql",sql); 
															 | 
															
															 | 
															
																        params.put("sql",sql); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("selectZyRecord:"+sql); 
															 | 
															
															 | 
															
																        logger.info("selectZyRecord:"+sql); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -748,11 +767,21 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject rs = JSON.parseObject(content); 
															 | 
															
															 | 
															
																        JSONObject rs = JSON.parseObject(content); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Integer status = rs.getInteger("status"); 
															 | 
															
															 | 
															
																        Integer status = rs.getInteger("status"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONArray array = new JSONArray(); 
															 | 
															
															 | 
															
																        JSONArray array = new JSONArray(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        JSONArray array1 = new JSONArray(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(status!=null&&status == 200){ 
															 | 
															
															 | 
															
																        if(status!=null&&status == 200){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            array = rs.getJSONArray("detailModelList"); 
															 | 
															
															 | 
															
																            array = rs.getJSONArray("detailModelList"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            for (int i = 0;i<array.size();i++){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                JSONObject jsonObject = JSONObject.parseObject(array.get(i).toString()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if (jsonObject.get("SFZH")!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    String szfh = jsonObject.getString("SFZH"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    jsonObject.put("sex",IdCardUtil.getSexForIdcard(szfh)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    jsonObject.put("age",IdCardUtil.getAgeForIdcard(szfh)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                array1.add(jsonObject); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            logger.info("selectZyRecord size:"+array.size()); 
															 | 
															
															 | 
															
																            logger.info("selectZyRecord size:"+array.size()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return array; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return array1; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -823,7 +852,6 @@ public class TnyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "\tV_ZY_BRRY brry\n" + 
															 | 
															
															 | 
															
																                "\tV_ZY_BRRY brry\n" + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "where\n" + 
															 | 
															
															 | 
															
																                "where\n" + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                "  brry.BAHM ='"+brid+"' "; 
															 | 
															
															 | 
															
																                "  brry.BAHM ='"+brid+"' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        sql += " order by h.KSSJ desc"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
															
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("sql",sql); 
															 | 
															
															 | 
															
																        params.put("sql",sql); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        HttpResponse response = HttpUtils.doGet(url,params); 
															 | 
															
															 | 
															
																        HttpResponse response = HttpUtils.doGet(url,params); 
															 |