Browse Source

更新报告匹配

刘韬 5 years ago
parent
commit
14e876997c

+ 3 - 3
DataFusion/res/config.properties

@@ -1,6 +1,6 @@
 #DB-connected partners
-jdbcUrl_connected  = jdbc:oracle:thin:@192.168.100.4:1521:pacs
-user_connected 	   = jk
-password_connected = jk
+jdbcUrl_connected  = jdbc:oracle:thin:@192.168.1.101:1521:orcl11g
+user_connected 	   = OT
+password_connected = OT
 #DATA-Parms
 institution_id     = 47600001

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

@@ -64,13 +64,13 @@ public class ZskkConfig extends JFinalConfig {
 	@Override
 	public void configPlugin(Plugins me) {
 		// 配置数据库连接池插件
-//		DruidPlugin druidPluginConnected = createConnectedDruidPlugin();
-//		me.add(druidPluginConnected);
+		DruidPlugin druidPluginConnected = createConnectedDruidPlugin();
+		me.add(druidPluginConnected);
 //
 //		// 配置ActiveRecord插件
-//		ActiveRecordPlugin arpConnected = new ActiveRecordPlugin("connected", druidPluginConnected);
-//		arpConnected.setDialect(new OracleDialect());
-//		me.add(arpConnected);
+		ActiveRecordPlugin arpConnected = new ActiveRecordPlugin("connected", druidPluginConnected);
+		arpConnected.setDialect(new OracleDialect());
+		me.add(arpConnected);
 
 		
 		Cron4jPlugin cpData = new Cron4jPlugin();

+ 4 - 11
DataFusion/src/com/zskk/service/DataService.java

@@ -3,12 +3,10 @@ package com.zskk.service;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
-
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.jfinal.kit.PropKit;
-
 import okhttp3.FormBody;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
@@ -17,7 +15,7 @@ import okhttp3.Response;
 
 public class DataService {
 	
-    private static String GET_EXAM_URL = "https://risserver3.pacsonline.cn/butt/getExam/butt/getExam";
+    private static String GET_EXAM_URL = "https://risserver3.pacsonline.cn/butt/getExam";
     
     private static String SAVE_REPORT_URL = "https://risserver3.pacsonline.cn/butt/saveReport";
 	
@@ -38,10 +36,7 @@ public class DataService {
 			return null;
 		}
 		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
-	      System.out.println(jsonArray);
-
 		return jsonArray;
-		
 	}
     
     /**
@@ -49,11 +44,10 @@ public class DataService {
      * @param instutionId
      * @param number
      */
-    public void saveReport(String instutionId, Integer number) {
-    	Map <String,String> map = new HashMap<String,String>();
-		postWithParameters(SAVE_REPORT_URL, map);
-		
+    public void saveReport(Map<String, String> map) {
+		postWithParameters(SAVE_REPORT_URL, map);	
 	}
+
     
     public static String postWithParameters(String url, Map<String, String> map) {
     	
@@ -72,7 +66,6 @@ public class DataService {
 		    try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
 		      if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
 		      String content = response.body().string();
-		      System.out.println(content);
 		      return content;
 		    } catch (IOException e) {
 				// TODO Auto-generated catch block

+ 2 - 76
DataFusion/src/com/zskk/task/DataTask.java

@@ -22,54 +22,6 @@ public class DataTask implements ITask {
 	@Override
 	public void run() {
 		// TODO Auto-generated method stub
-<<<<<<< HEAD
-		try {
-			List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=81069902 order by createdAt desc limit 30");
-			for (Exams exams2 : exams) {
-				try {
-					Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
-					Record record = Db.use("connected").findFirst("select * from PACSONLINE_Interface where STUDYUID=?",studies.getStudyuid());
-					if (record == null) {
-						continue;
-					}
-					Report report = new Report().use("zskk");
-					report.setId(creatId());
-					report.setReportDatetime(parseStringToDate(record.getStr("REPORTDATE")));
-					if (record.getStr("IMPRESSION") == null && record.getStr("DESCRIPTION") == null) {
-						continue;
-					}
-					report.setImpression(record.getStr("IMPRESSION"));
-					report.setDescription(record.getStr("DESCRIPTION"));
-					report.setExamId(exams2.getId());
-					report.setCreatedAt(new Date());
-					report.setReportDoctorId(getDoctorIdByName(record.getStr("REPORTDOCTOR")));
-					report.setReviewDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
-					report.setReviewDatetime(parseStringToDate(record.getStr("REPORTDATE")));
-					report.setConfirmDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
-					report.setConfirmDatetime(parseStringToDate(record.getStr("REPORTDATE")));
-					report.save();
-					PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
-					patientInfos.setName(record.getStr("PATIENTNAME"));
-//					patientInfos.setPhone(record.getStr("telephone"));
-					patientInfos.setCardNum(record.getStr("IDCARD"));
-					patientInfos.update();
-					exams2.setExamStatus(9);
-					exams2.setApplicationDepartment(record.getStr("DEPARTMENT"));
-					exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
-					exams2.update();
-
-					
-				} catch (Exception e) {
-					// TODO: handle exception
-					continue;
-				}
-			}
-
-		} catch (Exception e) {
-			// TODO: handle exception
-			
-		}
-=======
 		DataService dService = ServiceFactory.getService(DataService.class);
         JSONArray jsonArray = dService.getExamList(30);	
         for (Object object : jsonArray) {
@@ -108,11 +60,11 @@ public class DataTask implements ITask {
 			params.put("clin_diag", "");
 			//patient_infos表
 			//患者姓名
-			params.put("name",record.getStr("patientname"));
+			params.put("name",record.getStr("PATIENTNAME"));
 			//患者手机号
 			params.put("phone", "");
 			//患者身份证号
-			params.put("card_num", "");
+			params.put("card_num", record.getStr("IDCARD"));
 			params.put("report_result", "1");
 			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
 			tService.execute(() -> {
@@ -128,32 +80,6 @@ public class DataTask implements ITask {
 
 	}
 
-	private String creatId() {
-		UUID id = UUID.randomUUID();
-		String[] idd = id.toString().split("-");
-		return idd[0] + idd[1] + idd[2];
-	}
-
-	private String getDoctorIdByName(String name) {
-		if (name == null) {
-			return null;
-		}
-		Doctors doctors = Doctors.dao.use("zskk").findFirst("SELECT * FROM doctors where instr(?,realname) and institution_id=81069902 and realname<>''", name);
-		if (doctors == null) {
-			Doctors newDoctors = new Doctors().use("zskk");
-			newDoctors.setId(creatId());
-			newDoctors.setUsername("none");
-			newDoctors.setRealname(name);
-			newDoctors.setPassword("123456");
-			newDoctors.setInstitutionId("81069902");
-			newDoctors.setCreatedAt(new Date());
-			newDoctors.setUpdatedAt(new Date());
-			newDoctors.save();
-			return newDoctors.getId();
-		}
-		return doctors.getId();
-	}
-
 	private Date parseStringToDate(String dateStr) {
 		if (dateStr == null) {
 			return new Date();