| 
					
				 | 
			
			
				@ -4054,12 +4054,56 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public net.sf.json.JSONObject setRecord(String json)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public net.sf.json.JSONObject setRecord(String json,String type)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        net.sf.json.JSONObject rs = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        ArchiveVO archiveVO = objectMapper.readValue(json,ArchiveVO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(archiveVO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           return entranceService.BS16018(archiveVO,demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isBlank(archiveVO.getBrnl00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               archiveVO.setBrnl00(IdCardUtil.getAgeForIdcard(archiveVO.getSfzhao())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isBlank(archiveVO.getCsrq00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               archiveVO.setCsrq00(DateUtil.dateToStr(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()),"yyyyMMdd")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //1为需要同步建档 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if("1".equals(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs = entranceService.BS16018(archiveVO,demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //保存互联网医院居民账户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patientDO = savePatient(archiveVO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("patient",patientDO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return rs; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 存储居民 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param archiveVO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public BasePatientDO savePatient(ArchiveVO archiveVO)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(archiveVO.getSfzhao(),"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(patientDO == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patient = new BasePatientDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String salt = UUID.randomUUID().toString().substring(0, 5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String mobile = archiveVO.getYytel0(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String pw = mobile.substring(mobile.length() - 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setIdcard(archiveVO.getSfzhao()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setName(archiveVO.getXming0()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setSalt(salt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setMobile(mobile); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setEnabled(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setLocked(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setUpdateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient.setBirthday(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return basePatientDao.save(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return patientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 |