|  | @ -0,0 +1,308 @@
 | 
	
		
			
				|  |  | package com.yihu.wlyy.service.third.jw;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.wlyy.util.HttpClientUtil;
 | 
	
		
			
				|  |  | import org.apache.http.NameValuePair;
 | 
	
		
			
				|  |  | import org.apache.http.message.BasicNameValuePair;
 | 
	
		
			
				|  |  | import org.slf4j.Logger;
 | 
	
		
			
				|  |  | import org.slf4j.LoggerFactory;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | import org.springframework.jdbc.core.JdbcTemplate;
 | 
	
		
			
				|  |  | import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.ArrayList;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by yeshijie on 2017/9/25.
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | @Service
 | 
	
		
			
				|  |  | public class JwMaternalChildService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private static final Logger logger = LoggerFactory.getLogger(JwMaternalChildService.class);
 | 
	
		
			
				|  |  |     //基卫服务地址
 | 
	
		
			
				|  |  |     @Value("${sign.check_upload}")
 | 
	
		
			
				|  |  |     private String jwUrl;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private HttpClientUtil httpClientUtil;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private JdbcTemplate jdbcTemplate;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取孕妇建卡信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalFirstExamRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalFirstExamRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取非第一次产检记录
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @param pregnancyNo 产检号
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalReExamRecord(String idcard,String hospital,String pregnancyNo) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalReExamRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("pregnancyNo", pregnancyNo));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取产床预约信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalBedPrecontractRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalBedPrecontractRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取高危产妇信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalPregnancyHighRecord( String idcard, String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalPregnancyHighRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取孕妇分娩信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalDeliveryRecord(String idcard, String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalDeliveryRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取新生儿基本信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalDeliveryChildRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalDeliveryChildRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取儿童健康体检0-6岁记录
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalChildMedicalRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalChildMedicalRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取新生儿访视信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalHomeVisitRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalHomeVisitRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取新生儿免疫记录
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalChildImmuneRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalChildImmuneRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取孕妇预建卡信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalPreFirstExamRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalPreFirstExamRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 上传孕妇预建卡信息
 | 
	
		
			
				|  |  |      * @param code 预建卡code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String SaveEhrMaternalPreFirstExamRecord(String code) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/SaveEhrMaternalPreFirstExamRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("code", code));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 上传新生儿访视信息
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String SaveEhrMaternalHomeVisitRecord(String idcard,String hospital) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/SaveEhrMaternalHomeVisitRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取待产记录
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @param searchTime 查询时间
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalZSPreDeliveryRecord(String idcard,String hospital,String searchTime) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalZSPreDeliveryRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("searchTime", searchTime));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取阴道分娩记录
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @param searchTime 查询时间
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalZSDeliveryRecord(String idcard, String hospital, String searchTime) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalZSDeliveryRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("searchTime", searchTime));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取剖宫产记录
 | 
	
		
			
				|  |  |      * @param idcard 身份证
 | 
	
		
			
				|  |  |      * @param hospital 医院code
 | 
	
		
			
				|  |  |      * @param searchTime 查询时间
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getEhrMaternalZSCaesareanBirthRecord(String idcard, String hospital, String searchTime) throws Exception{
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prenatalInspector/getEhrMaternalZSCaesareanBirthRecord";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("idcard", idcard));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("hospital", hospital));
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("searchTime", searchTime));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | }
 |