| 
					
				 | 
			
			
				@ -1218,6 +1218,35 @@ public class XzzxEntranceService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jsonObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String savePatientMapping(String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientDO patientDO = patientDao.findById(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String response=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String idCard = patientDO.getIdcard(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = entranceUrl+"findPatientCard?idCard="+idCard; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        response = httpClientUtil.get(url,"GBK"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject object = JSONObject.parseObject(response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(object.getInteger("status")==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String obj = object.getString("obj"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONArray array = JSONArray.parseArray(obj).getJSONArray(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (array!=null&&array.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject object1 = array.getJSONObject(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (patientMappingDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO = new PatientMappingDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setIdcard(patientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setPatientName(patientDO.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setPatient(patientDO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setSource("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setMappingCode(object1.getString("SICKID")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    patientMappingDO.setMappingCode(object1.getString("SICKID")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientMappingDO = patientMappingDao.save(patientMappingDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return patientMappingDO.getMappingCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取门诊就诊记录列表 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1232,7 +1261,7 @@ public class XzzxEntranceService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientMappingDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient = patientMappingDO.getMappingCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient = savePatientMapping(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = entranceUrl+"findOutpatientInfo?patient="+patient+"&startTime="+startTime+"&endTime="+endTime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        response = httpClientUtil.get(url,"GBK"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1284,7 +1313,7 @@ public class XzzxEntranceService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientMappingDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient = patientMappingDO.getMappingCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient = savePatientMapping(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = entranceUrl+"findOutpatientInfo?patient="+patient+"&conNo="+conNo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        response = httpClientUtil.get(url,"GBK"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1536,7 +1565,7 @@ public class XzzxEntranceService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setSerial(isEmty(infoJson.getString("SERIAL"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    /*    prescriptionInfoVO.setGroupNo(isEmty(infoJson.getString("groupNo")));*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setSpecification(isEmty(infoJson.getString("SPECIFICATION"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setPackRetprice(infoJson.getDouble("PACKRETPRICE")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setPackRetprice(isEmty(infoJson.getString("PACKRETPRICE"))==null?0.0:infoJson.getDouble("PACKRETPRICE")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setHerbalCount(isEmty(infoJson.getString("HERBALCOUNT"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setPostCount(isEmty(infoJson.getString("POSTCOUNT"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        prescriptionInfoVO.setDel(infoJson.getInteger("DEL")); 
			 |