| 
					
				 | 
			
			
				@@ -7,6 +7,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.dynamic.datasource.annotation.DS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import lombok.extern.slf4j.Slf4j; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.client.RestTemplate; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -30,6 +31,7 @@ import thyyxxk.webserver.service.redislike.RedisLikeService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import thyyxxk.webserver.utils.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import thyyxxk.webserver.websocket.WebSocketServer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import javax.annotation.PostConstruct; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import javax.websocket.Session; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.stream.Collectors; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -39,7 +41,6 @@ import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Slf4j 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @DS("his") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 public class EmrServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final EmrPatientDao dao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final EmrEditor emr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final PublicServer publicServer; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -62,24 +63,7 @@ public class EmrServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public ResultVo<List<EmrPatientData>> getPatientDataTree(String patNo, Integer times) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<EmrPatientData> data = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Map<String, List<EmrPatientData>> map = dao.getPatientData(patNo, times).stream().collect(Collectors.groupingBy(EmrPatientData::getEmrCategoryCode)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for (Map.Entry<String, List<EmrPatientData>> key : map.entrySet()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (key.getValue().size() == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                data.add(key.getValue().get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                EmrPatientData item = new EmrPatientData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                List<EmrPatientData> children = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                for (int i = 0, len = key.getValue().size(); i < len; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    EmrPatientData childNode = key.getValue().get(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    children.add(childNode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setName(key.getValue().get(0).getEmrName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setChildren(new ArrayList<>()).getChildren().addAll(children); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                data.add(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return ResultVoUtil.success(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return ResultVoUtil.success(dao.getPatientData(patNo, times)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public ResultVo<Map<String, List<JSONObject>>> getEmrTree(String type) { 
			 |