| 
					
				 | 
			
			
				@ -31,10 +31,13 @@ import com.yihu.wlyy.service.common.SMSService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.PatientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.TokenService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.login.LoginLogService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.third.jw.JwArchivesService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.MD5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.json.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.JdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.stereotype.Component; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -87,7 +90,10 @@ public class PatientInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    PatientService patientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    SystemDictDao systemDictDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    JwArchivesService jwArchivesService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    JdbcTemplate jdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 患者更换手机号 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -328,4 +334,53 @@ public class PatientInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public int createProfile(String doctorCode ,String patient,String jwCountryCode,String nation,String blood,String marry)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Patient p = patientDao.findByCode(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject json = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("ARCHIVE_TIME", DateUtil.getStringDateShort());//建档时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("ARCHIVE_STATUS","3");//档案状态【1.未管理 2.死亡 3.正常 4.高危】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("SICK_NAME",p.getName());//姓名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("SICK_SEX",p.getSex());//性别【1.男 2.女 9 未知】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("BIRTHDAY",p.getBirthday());//出生日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("ZONE_CODE",jwCountryCode);//所属社区【ZONE_DICT】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("IDENTITY_TYPE","1");//证件类型【IDENTITY_TYPE_DICT】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("IDENTITY_CARD_NO",p.getIdcard());//身份证号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("HOME_PHONE",p.getMobile());//本人电话 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("HOME_ADDRESS","测试地址");//现住址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("ORG_ID","0");//新增默认传0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("RESIDENCE","1");//户籍【1.户籍 2.非户籍】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("NATIONAL",nation);//民族【NATION_DICT】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("ORIGO","3502030502");//户口所在地【ZONE_DICT】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("BLOOD",blood);//血型【1.A型 2.3.O型4.AB型 5.不详】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        json.put("MARRIAGE",marry);//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String doctor = doctorCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String response = jwArchivesService.saveSickArchiveRecord(json.toString(),doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public  List<Map<String,Object>> getNationDict(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT t.NATION_CODE,t.NATION_NAME FROM zy_nation_dict t "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return rs; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> getMarryDict(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return getDictByName("MARRY_STATE"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> getBloodDict(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return getDictByName("BLOOD_TYPE"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> getDictByName(String name){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT t.code,t.`value` FROM system_dict t WHERE t.dict_name=?"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql,new Object[]{name}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return rs; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |