|  | @ -11,6 +11,7 @@ import com.yihu.wlyy.util.XMLUtil;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.apache.http.NameValuePair;
 | 
	
		
			
				|  |  | import org.apache.http.message.BasicNameValuePair;
 | 
	
		
			
				|  |  | import org.apache.poi.util.StringUtil;
 | 
	
		
			
				|  |  | import org.json.JSONArray;
 | 
	
		
			
				|  |  | import org.json.JSONObject;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
	
		
			
				|  | @ -79,14 +80,20 @@ public class OutpatientService extends BaseService {
 | 
	
		
			
				|  |  |                             String key = patientId + eventNo + orgId;
 | 
	
		
			
				|  |  |                             JSONObject catalogObject = new JSONObject();
 | 
	
		
			
				|  |  |                             String catalogCode = jsonObject.get("CATALOG_CODE").toString();
 | 
	
		
			
				|  |  |                             String endTimeNew = jsonObject.get("END_TIME").toString();
 | 
	
		
			
				|  |  |                             String catalogValue = systemDictMap.get(catalogCode);
 | 
	
		
			
				|  |  |                             jsonObject.remove("CATALOG_CODE");
 | 
	
		
			
				|  |  |                             if (jsonObjectMap.containsKey(key)) {
 | 
	
		
			
				|  |  |                                 jsonObject = jsonObjectMap.get(key);
 | 
	
		
			
				|  |  |                                 String endTimeOld = jsonObject.get("END_TIME").toString();
 | 
	
		
			
				|  |  |                                 if (endTimeNew.compareTo(endTimeOld) < 0) {
 | 
	
		
			
				|  |  |                                     endTimeNew = endTimeOld;
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                                 catalogObject = jsonObject.getJSONObject("CATALOG");
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                             catalogObject.put(catalogCode, catalogValue);
 | 
	
		
			
				|  |  |                             jsonObject.put("CATALOG", catalogObject);
 | 
	
		
			
				|  |  |                             jsonObject.put("END_TIME", endTimeNew);
 | 
	
		
			
				|  |  |                             jsonObjectMap.put(key, jsonObject);
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  | 
 |