刘韬 1 年之前
父节点
当前提交
984ce2ea91

+ 19 - 19
DataFusion/src/com/zskk/config/ZskkConfig.java

@@ -73,21 +73,21 @@ public class ZskkConfig extends JFinalConfig {
 
 	@Override
 	public void configPlugin(Plugins me) {
-		// 配置数据库连接池插件
-		DruidPlugin druidPluginConnected = createConnectedDruidPlugin();
-		me.add(druidPluginConnected);
-		
-		DruidPlugin druidPluginLocal = createLocalDruidPlugin();
-		me.add(druidPluginLocal);
-
-		// 配置ActiveRecord插件
-		ActiveRecordPlugin arpConnected = new ActiveRecordPlugin("connected", druidPluginConnected);
-		arpConnected.setDialect(new OracleDialect());
-		me.add(arpConnected);
-		
-		ActiveRecordPlugin arpLocal = new ActiveRecordPlugin("local", druidPluginLocal);
-		arpLocal.setDialect(new MysqlDialect());
-		me.add(arpLocal);
+//		// 配置数据库连接池插件
+//		DruidPlugin druidPluginConnected = createConnectedDruidPlugin();
+//		me.add(druidPluginConnected);
+//		
+//		DruidPlugin druidPluginLocal = createLocalDruidPlugin();
+//		me.add(druidPluginLocal);
+//
+//		// 配置ActiveRecord插件
+//		ActiveRecordPlugin arpConnected = new ActiveRecordPlugin("connected", druidPluginConnected);
+//		arpConnected.setDialect(new OracleDialect());
+//		me.add(arpConnected);
+//		
+//		ActiveRecordPlugin arpLocal = new ActiveRecordPlugin("local", druidPluginLocal);
+//		arpLocal.setDialect(new MysqlDialect());
+//		me.add(arpLocal);
 		
 		//同步报告
 //		Cron4jPlugin cpData = new Cron4jPlugin();
@@ -95,10 +95,10 @@ public class ZskkConfig extends JFinalConfig {
 //		me.add(cpData);
 		
 		//将cfind请求检查录入待检查库
-		Cron4jPlugin inData = new Cron4jPlugin();
-		inData.addTask("*/4 * * * *", new UpdateTask());
-		me.add(inData);
-		
+//		Cron4jPlugin inData = new Cron4jPlugin();
+//		inData.addTask("*/4 * * * *", new UpdateTask());
+//		me.add(inData);
+//		
 		//执行cfind请求
 //		Cron4jPlugin cgData = new Cron4jPlugin();
 //		cgData.addTask("*/2 * * * *", new CFindTask());

+ 19 - 0
DataFusion/src/com/zskk/control/ViewController.java

@@ -16,6 +16,9 @@ import java.util.Map;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.NodeList;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.jfinal.core.Controller;
 import com.jfinal.kit.PropKit;
 import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
@@ -42,6 +45,10 @@ public class ViewController extends Controller {
 	private static final MediaType JSON_CODE = MediaType.get("application/json; charset=utf-8");
 
 	private static final OkHttpClient OKHTTP_CLIENT = new OkHttpClient();
+	
+  private static String GET_EXAM_URL = "https://risserver3.pacsonline.cn/butt/getExam";
+  
+  private static String SAVE_REPORT_URL = "https://risserver3.pacsonline.cn/butt/saveReport";
 
 	/**
 	 * 在被连接数据库执行sql语句
@@ -52,6 +59,18 @@ public class ViewController extends Controller {
 		this.renderJson(d);
 	}
 	
+	public void getExam() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+		String content = dService.getExamList(80);
+		this.renderText(content);
+	}
+	
+	public void saveReport() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+//		this.getParaMap();
+		this.renderJson(this.getParaMap());
+	}
+	
 	public void exe() {
 		Integer max = 5;
 		List<Record> count = Db.use("local").find("select * from study where status =4");

+ 33 - 10
DataFusion/src/com/zskk/service/DataService.java

@@ -31,30 +31,53 @@ import okhttp3.Response;
 
 public class DataService {
 	
-    private static String GET_EXAM_URL = "https://risserver3.pacsonline.cn/butt/getExam";
-    
-    private static String SAVE_REPORT_URL = "https://risserver3.pacsonline.cn/butt/saveReport";
+//    private static String GET_EXAM_URL = "https://risserver3.pacsonline.cn/butt/getExam";
+//    
+//    private static String SAVE_REPORT_URL = "https://risserver3.pacsonline.cn/butt/saveReport";
     
     private static String UPDATE_PATIENT_URL = "https://risserver3.pacsonline.cn/butt/saveExam";
+    
+    private static String GET_EXAM_URL = "http://172.16.100.80:8080/view/getExam";
+    
+    private static String SAVE_REPORT_URL = "http://172.16.100.80:8080/view/saveReport";
 	
     private static final OkHttpClient OKHTTP_CLIENT = new OkHttpClient();
     
+//    /**
+//     * 获取未出报告的检查列表
+//     * @param instutionId
+//     * @param number
+//     */
+//    public JSONArray getExamList(Integer number) {
+//    	Map <String,String> map = new HashMap<String,String>();
+//    	map.put("institution_id", PropKit.get("institution_id"));
+//    	map.put("num", number.toString());
+//		String content = postWithParameters(GET_EXAM_URL, map);
+//	    JSONObject jsonObject = JSON.parseObject(content);
+//	    if (!jsonObject.getString("msg").equals("success")) {
+//			return null;
+//		}
+//		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
+//		return jsonArray;
+//		
+//	}
+    
     /**
      * 获取未出报告的检查列表
      * @param instutionId
      * @param number
      */
-    public JSONArray getExamList(Integer number) {
+    public String getExamList(Integer number) {
     	Map <String,String> map = new HashMap<String,String>();
     	map.put("institution_id", PropKit.get("institution_id"));
     	map.put("num", number.toString());
 		String content = postWithParameters(GET_EXAM_URL, map);
-	    JSONObject jsonObject = JSON.parseObject(content);
-	    if (!jsonObject.getString("msg").equals("success")) {
-			return null;
-		}
-		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
-		return jsonArray;
+//	    JSONObject jsonObject = JSON.parseObject(content);
+//	    if (!jsonObject.getString("msg").equals("success")) {
+//			return null;
+//		}
+//		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
+		return content;
 		
 	}
     

+ 90 - 90
DataFusion/src/com/zskk/task/DataTask.java

@@ -20,96 +20,96 @@ public class DataTask implements ITask {
 	@Override
 	public void run() {
 		// TODO Auto-generated method stub
-		DataService dService = ServiceFactory.getService(DataService.class);
-		JSONArray jsonArray = dService.getExamList(80);
-		for (Object object : jsonArray) {
-			try {
-				JSONObject jsonObject = JSON.parseObject(object.toString());
-				Record record = Db.use("connected").findFirst("select * from reportinfo where examNo=?",
-						jsonObject.getString("patient_num"));
-				if (record == null) {
-					continue;
-				}
-				if (record.getStr("description") == null && record.getStr("impression") == null) {
-					continue;
-				}
-				if (record.getStr("department").equals("健康体检科")) {
-					Date date = new Date();
-					long nowdate = date.getTime();
-					
-					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		            Date datesh = sdf.parse(record.getStr("reviewdate"));
-					long dateshl = datesh.getTime();
-					//体检延时48h
-					if ((nowdate - dateshl) < 172800000) {
-						continue;
-					}
-				}
-				Map<String, String> params = new HashMap<>();
-				//1:exam_id 2:patient_num 3:accession_num 4:study_uid
-				params.put("type", "1");
-				
-				params.put("institution_id", PropKit.get("institution_id"));
-
-				params.put("code", jsonObject.getString("id"));
-				// 报告医生姓名
-				params.put("report_doctor_name", record.getStr("reportdoctor"));
-				// 报告时间
-				params.put("report_datetime", record.getStr("reportdate"));
-				// 审核医生姓名
-				params.put("review_doctor_name",
-						record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
-				// 审核时间
-				params.put("review_datetime", record.getStr("reviewdate"));
-				// 确认医生姓名
-				params.put("confirm_doctor_name",
-						record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
-				// 确认时间
-				params.put("confirm_datetime", record.getStr("reviewdate"));
-				// 意见建议
-				params.put("impression", record.getStr("impression"));
-				// 影像所见
-				params.put("description", record.getStr("description"));
-				// exams表
-				// 申请科室
-				params.put("application_department", record.getStr("department"));
-				// 申请医生
-				params.put("application_doctor", record.getStr("clinicaldoctor"));
-				// 临床诊断
-				params.put("clin_diag", record.getStr("diagnosis") == null ? "" : record.getStr("diagnosis"));
-				// 症状
-				params.put("clin_symp", record.getStr("symptom") == null ? "" : record.getStr("symptom"));
-				// patient_infos表
-				// 患者姓名
-				params.put("name", record.getStr("patientname"));
-				// 患者手机号
-				params.put("phone", record.getStr("phone") == null ? "" : record.getStr("phone"));
-				// 患者身份证号
-				params.put("card_num", record.getStr("idcard") == null ? "" : record.getStr("idcard"));
-				// 检查结果1阴2阳
-				String resultString = "";
-				if (record.getStr("result")!=null) {
-					resultString = record.getStr("result").contains("阳") ? "2" : "1";
-				}
-				params.put("report_result", resultString);
-				// 门诊号住院号
-				params.put("hopitalized_no", record.getStr("inPatientNum") == null ? "" : record.getStr("inPatientNum"));
-				// 门诊号
-				params.put("out_patient", record.getStr("outPatientNum") == null ? "" : record.getStr("outPatientNum"));
-				// 病人ID
-				params.put("his_patient_id", record.getStr("patientid") == null ? "" : record.getStr("patientid"));
-				// 检查方法
-				params.put("exam_project", record.getStr("project"));
-				ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
-				tService.execute(() -> {
-					dService.saveReport(params);
-				});
-			} catch (Exception e) {
-				// TODO: handle exception
-				continue;
-			}
-			
-		}
+//		DataService dService = ServiceFactory.getService(DataService.class);
+//		JSONArray jsonArray = dService.getExamList(80);
+//		for (Object object : jsonArray) {
+//			try {
+//				JSONObject jsonObject = JSON.parseObject(object.toString());
+//				Record record = Db.use("connected").findFirst("select * from reportinfo where examNo=?",
+//						jsonObject.getString("patient_num"));
+//				if (record == null) {
+//					continue;
+//				}
+//				if (record.getStr("description") == null && record.getStr("impression") == null) {
+//					continue;
+//				}
+//				if (record.getStr("department").equals("健康体检科")) {
+//					Date date = new Date();
+//					long nowdate = date.getTime();
+//					
+//					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//		            Date datesh = sdf.parse(record.getStr("reviewdate"));
+//					long dateshl = datesh.getTime();
+//					//体检延时48h
+//					if ((nowdate - dateshl) < 172800000) {
+//						continue;
+//					}
+//				}
+//				Map<String, String> params = new HashMap<>();
+//				//1:exam_id 2:patient_num 3:accession_num 4:study_uid
+//				params.put("type", "1");
+//				
+//				params.put("institution_id", PropKit.get("institution_id"));
+//
+//				params.put("code", jsonObject.getString("id"));
+//				// 报告医生姓名
+//				params.put("report_doctor_name", record.getStr("reportdoctor"));
+//				// 报告时间
+//				params.put("report_datetime", record.getStr("reportdate"));
+//				// 审核医生姓名
+//				params.put("review_doctor_name",
+//						record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
+//				// 审核时间
+//				params.put("review_datetime", record.getStr("reviewdate"));
+//				// 确认医生姓名
+//				params.put("confirm_doctor_name",
+//						record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
+//				// 确认时间
+//				params.put("confirm_datetime", record.getStr("reviewdate"));
+//				// 意见建议
+//				params.put("impression", record.getStr("impression"));
+//				// 影像所见
+//				params.put("description", record.getStr("description"));
+//				// exams表
+//				// 申请科室
+//				params.put("application_department", record.getStr("department"));
+//				// 申请医生
+//				params.put("application_doctor", record.getStr("clinicaldoctor"));
+//				// 临床诊断
+//				params.put("clin_diag", record.getStr("diagnosis") == null ? "" : record.getStr("diagnosis"));
+//				// 症状
+//				params.put("clin_symp", record.getStr("symptom") == null ? "" : record.getStr("symptom"));
+//				// patient_infos表
+//				// 患者姓名
+//				params.put("name", record.getStr("patientname"));
+//				// 患者手机号
+//				params.put("phone", record.getStr("phone") == null ? "" : record.getStr("phone"));
+//				// 患者身份证号
+//				params.put("card_num", record.getStr("idcard") == null ? "" : record.getStr("idcard"));
+//				// 检查结果1阴2阳
+//				String resultString = "";
+//				if (record.getStr("result")!=null) {
+//					resultString = record.getStr("result").contains("阳") ? "2" : "1";
+//				}
+//				params.put("report_result", resultString);
+//				// 门诊号住院号
+//				params.put("hopitalized_no", record.getStr("inPatientNum") == null ? "" : record.getStr("inPatientNum"));
+//				// 门诊号
+//				params.put("out_patient", record.getStr("outPatientNum") == null ? "" : record.getStr("outPatientNum"));
+//				// 病人ID
+//				params.put("his_patient_id", record.getStr("patientid") == null ? "" : record.getStr("patientid"));
+//				// 检查方法
+//				params.put("exam_project", record.getStr("project"));
+//				ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//				tService.execute(() -> {
+//					dService.saveReport(params);
+//				});
+//			} catch (Exception e) {
+//				// TODO: handle exception
+//				continue;
+//			}
+//			
+//		}
 	}
 
 	@Override

+ 58 - 58
DataFusion/src/com/zskk/task/InfoTask.java

@@ -20,64 +20,64 @@ public class InfoTask implements ITask {
 	@Override
 	public void run() {
 		// TODO Auto-generated method stub
-		DataService dService = ServiceFactory.getService(DataService.class);
-		JSONArray jsonArray = dService.getExamList(20);
-		for (Object object : jsonArray) {
-			JSONObject jsonObject = JSON.parseObject(object.toString());
-			Record record = Db.use("connected").findFirst("select * from examinfo where accessionNumber=?",
-					jsonObject.getString("accession_num"));
-			if (record == null) {
-				continue;
-			}
-			Map<String, String> params = new HashMap<>();
-			params.put("exam_id", jsonObject.getString("id"));
-			// 报告医生姓名
-			params.put("report_doctor_name", "");
-			// 报告时间
-			params.put("report_datetime", "");
-			// 审核医生姓名
-			params.put("review_doctor_name", "");
-			// 审核时间
-			params.put("review_datetime", "");
-			// 确认医生姓名
-			params.put("confirm_doctor_name", "");
-			// 确认时间
-			params.put("confirm_datetime", "");
-			// 意见建议
-			params.put("impression", "");
-			// 影像所见
-			params.put("description", "");
-			// exams表
-			// 申请科室
-			params.put("application_department", record.getStr("department"));
-			// 申请医生
-			params.put("application_doctor", record.getStr("clinicaldoctor"));
-			// 临床诊断
-			params.put("clin_diag", record.getStr("diagnosis") == null ? "" : record.getStr("diagnosis"));
-			// 症状
-			params.put("clin_symp", record.getStr("symptom") == null ? "" : record.getStr("symptom"));
-			// patient_infos表
-			// 患者姓名
-			params.put("name", record.getStr("patientname"));
-			// 患者手机号
-			params.put("phone", record.getStr("phone") == null ? "" : record.getStr("phone"));
-			// 患者身份证号
-			params.put("card_num", record.getStr("idcard") == null ? "" : record.getStr("idcard"));
-			// 检查结果1阴2阳
-			params.put("report_result", "0");
-			// 门诊号住院号
-			params.put("hopitalized_no", record.getStr("inPatientNum") == null ? "" : record.getStr("inPatientNum"));
-			// 门诊号
-			params.put("out_patient", record.getStr("outPatientNum") == null ? "" : record.getStr("outPatientNum"));
-			// 病人ID
-			params.put("his_patient_id", record.getStr("patientid") == null ? "" : record.getStr("patientid"));
-			// 检查方法
-			params.put("exam_project", record.getStr("project"));
-			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
-			tService.execute(() -> {
-				dService.updatePatientInfo(params);
-			});
-		}
+//		DataService dService = ServiceFactory.getService(DataService.class);
+//		JSONArray jsonArray = dService.getExamList(20);
+//		for (Object object : jsonArray) {
+//			JSONObject jsonObject = JSON.parseObject(object.toString());
+//			Record record = Db.use("connected").findFirst("select * from examinfo where accessionNumber=?",
+//					jsonObject.getString("accession_num"));
+//			if (record == null) {
+//				continue;
+//			}
+//			Map<String, String> params = new HashMap<>();
+//			params.put("exam_id", jsonObject.getString("id"));
+//			// 报告医生姓名
+//			params.put("report_doctor_name", "");
+//			// 报告时间
+//			params.put("report_datetime", "");
+//			// 审核医生姓名
+//			params.put("review_doctor_name", "");
+//			// 审核时间
+//			params.put("review_datetime", "");
+//			// 确认医生姓名
+//			params.put("confirm_doctor_name", "");
+//			// 确认时间
+//			params.put("confirm_datetime", "");
+//			// 意见建议
+//			params.put("impression", "");
+//			// 影像所见
+//			params.put("description", "");
+//			// exams表
+//			// 申请科室
+//			params.put("application_department", record.getStr("department"));
+//			// 申请医生
+//			params.put("application_doctor", record.getStr("clinicaldoctor"));
+//			// 临床诊断
+//			params.put("clin_diag", record.getStr("diagnosis") == null ? "" : record.getStr("diagnosis"));
+//			// 症状
+//			params.put("clin_symp", record.getStr("symptom") == null ? "" : record.getStr("symptom"));
+//			// patient_infos表
+//			// 患者姓名
+//			params.put("name", record.getStr("patientname"));
+//			// 患者手机号
+//			params.put("phone", record.getStr("phone") == null ? "" : record.getStr("phone"));
+//			// 患者身份证号
+//			params.put("card_num", record.getStr("idcard") == null ? "" : record.getStr("idcard"));
+//			// 检查结果1阴2阳
+//			params.put("report_result", "0");
+//			// 门诊号住院号
+//			params.put("hopitalized_no", record.getStr("inPatientNum") == null ? "" : record.getStr("inPatientNum"));
+//			// 门诊号
+//			params.put("out_patient", record.getStr("outPatientNum") == null ? "" : record.getStr("outPatientNum"));
+//			// 病人ID
+//			params.put("his_patient_id", record.getStr("patientid") == null ? "" : record.getStr("patientid"));
+//			// 检查方法
+//			params.put("exam_project", record.getStr("project"));
+//			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//			tService.execute(() -> {
+//				dService.updatePatientInfo(params);
+//			});
+//		}
 
 	}