You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					
					
						
							83 lines
						
					
					
						
							2.6 KiB
						
					
					
				
			
		
		
	
	
							83 lines
						
					
					
						
							2.6 KiB
						
					
					
				| package com.ynxbd.common.dao.his;
 | |
| 
 | |
| import com.ynxbd.common.bean.his.HisTreat;
 | |
| import com.ynxbd.common.bean.report.CheckReport;
 | |
| import com.ynxbd.common.helper.common.Base64Helper;
 | |
| import com.ynxbd.common.helper.common.JsonHelper;
 | |
| import com.ynxbd.common.helper.his.HisEnum;
 | |
| import com.ynxbd.common.helper.his.HisHelper;
 | |
| import com.ynxbd.common.result.JsonResult;
 | |
| import com.ynxbd.common.result.ServiceException;
 | |
| 
 | |
| import java.util.ArrayList;
 | |
| import java.util.List;
 | |
| import java.util.Map;
 | |
| 
 | |
| public class HisTreatDao {
 | |
| 
 | |
|     /**
 | |
|      * 根据患者id和科室编码查询就诊记录
 | |
|      *
 | |
|      * @param patientId 患者id
 | |
|      */
 | |
|     public List<HisTreat> getTreatList(String patientId, String deptCode) {
 | |
|         List<HisTreat> dataList = new ArrayList<>();
 | |
| 
 | |
|         JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_GET_TREAT_LIST, params -> {
 | |
|             params.put("PatientID", patientId);
 | |
|             params.put("DeptCode", deptCode);
 | |
|         });
 | |
| 
 | |
|         if (jsonResult.success()) {
 | |
|             dataList = jsonResult.getDataMapList(HisTreat.class, "Items", "Item");
 | |
|         }
 | |
|         return dataList;
 | |
|     }
 | |
| 
 | |
| 
 | |
|     /**
 | |
|      * 根据患者id查询检查报告
 | |
|      *
 | |
|      * @param treatNum 门诊号
 | |
|      */
 | |
|     public HisTreat createTreat(String treatNum) throws ServiceException {
 | |
|         JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_CREATE_TREAT, params -> {
 | |
|             params.put("MZNum", treatNum);
 | |
|         });
 | |
| 
 | |
|         if (jsonResult.success()) {
 | |
|             return JsonHelper.parseObject(JsonHelper.toJsonString(jsonResult.getDataMap()), HisTreat.class);
 | |
|         }
 | |
|         throw new ServiceException(jsonResult.getMessage());
 | |
|     }
 | |
| 
 | |
| 
 | |
|     public List<HisTreat> getInfoByTreatNum(String treatNum) throws ServiceException {
 | |
|         List<HisTreat> dataList = new ArrayList<>();
 | |
| 
 | |
|         JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_QUERY_TREAT, params -> {
 | |
|             params.put("MZNum", treatNum);
 | |
|         });
 | |
| 
 | |
|         if (jsonResult.success()) {
 | |
|             dataList = jsonResult.getDataMapList(HisTreat.class, "Items", "Item");
 | |
|         }
 | |
|         return dataList;
 | |
|     }
 | |
| 
 | |
|     public String getDoctCaSign(String doctCode) throws ServiceException {
 | |
|         String data = null;
 | |
|         JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_DOC_CA, params -> {
 | |
|             params.put("DoctCode", doctCode);
 | |
|         });
 | |
| 
 | |
|         if (jsonResult.success()) {
 | |
|             data = jsonResult.getDataMapString("Sign");
 | |
|             if (data == null) {
 | |
|                 return null;
 | |
|             }
 | |
|             data = Base64Helper.decode(data);
 | |
|         }
 | |
|         return data;
 | |
|     }
 | |
| }
 | |
| 
 |