LAPTOP-5NTQJPUS\LT 1 year ago
parent
commit
396460c787

+ 0 - 4
DataFusion/res/config.properties

@@ -9,9 +9,5 @@ jdbcUrl_local  = jdbc:mysql://127.0.0.1:3306/pacsonline?characterEncoding=utf8&z
 user_local 	   = zskk
 password_local = Zskk_2024
 
-#jdbcUrl_local  = jdbc:mysql://127.0.0.1:3306/pacsonline?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
-jdbcUrl_crb  = jdbc:oracle:thin:@11.129.12.58:1521:orcl
-user_crb	 = hz_dongmx
-password_crb = dongMx123
 #DATA-Parms
 institution_id = 27100009

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

@@ -87,13 +87,13 @@ public class ZskkConfig extends JFinalConfig {
 		arpLocal.setDialect(new MysqlDialect());
 		me.add(arpLocal);
 
-		Cron4jPlugin cpData = new Cron4jPlugin();
-		cpData.addTask("*/2 * * * *", new UpdateTask());
-		me.add(cpData);
-		
-		Cron4jPlugin usData = new Cron4jPlugin();
-		usData.addTask("*/2 * * * *", new USInfoTask());
-		me.add(usData);
+//		Cron4jPlugin cpData = new Cron4jPlugin();
+//		cpData.addTask("*/2 * * * *", new UpdateTask());
+//		me.add(cpData);
+//		
+//		Cron4jPlugin usData = new Cron4jPlugin();
+//		usData.addTask("*/2 * * * *", new USInfoTask());
+//		me.add(usData);
 		
 		//传染病上传
 		Cron4jPlugin crData = new Cron4jPlugin();

+ 19 - 6
DataFusion/src/com/zskk/service/DataService.java

@@ -23,7 +23,7 @@ public class DataService {
     
     private static String UPDATE_PATIENT_URL = "https://risserver3.pacsonline.cn/butt/saveExam";
     
-    private static String GET_REPORT_URL = "https://risserver3.pacsonline.cn/getDmReport";
+    private static String GET_REPORT_URL = "https://risserver3.pacsonline.cn/butt/getInsReport";
 
 	
     private static final OkHttpClient OKHTTP_CLIENT = new OkHttpClient();
@@ -78,7 +78,8 @@ public class DataService {
  	    if (!jsonObject.getString("msg").equals("success")) {
  			return null;
  		}
- 		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
+ 	    JSONObject jsonObject2 = JSON.parseObject(jsonObject.getString("data"));
+ 		JSONArray jsonArray = JSON.parseArray(jsonObject2.getString("info"));		
  		return jsonArray;
 	}
     
@@ -107,11 +108,23 @@ public class DataService {
 			}	
 	}
     
-//    public static void main(String[] args) {
+    public static void main(String[] args) {
 //    	Map <String,String> map = new HashMap<String,String>();
-//    	map.put("institution_id", "47600001");
+//    	map.put("institution_id", "27100009");
+//    	map.put("datetime", "2024-03-11 00:00:00,2024-03-11 23:00:00");
+//    	map.put("remote", "2");
+//    	map.put("page", "1");
 //    	map.put("num", "10");
-//		postWithParameters(GET_EXAM_URL, map);
-//	}
+//		postWithParameters(GET_REPORT_URL, map);
+//		String content = postWithParameters(GET_REPORT_URL, map);
+//    	JSONObject jsonObject = JSON.parseObject(content);
+// 	    if (!jsonObject.getString("msg").equals("success")) {
+//// 			return null;
+// 		}
+// 	    JSONObject jsonObject2 = JSON.parseObject(jsonObject.getString("data"));
+// 		JSONArray jsonArray = JSON.parseArray(jsonObject2.getString("info"));
+// 		System.out.print(jsonArray);
+		
+	}
 
 }

+ 24 - 48
DataFusion/src/com/zskk/task/CrbTask.java

@@ -8,6 +8,7 @@ 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 com.jfinal.plugin.activerecord.Db;
 import com.jfinal.plugin.activerecord.Record;
 import com.jfinal.plugin.cron4j.ITask;
@@ -23,57 +24,32 @@ public class CrbTask implements ITask {
 		DataService dService = ServiceFactory.getService(DataService.class);
 		Map<String, String> dateparams = new HashMap<>();
 		dateparams.put("datetime", parseStringToDate());
+		dateparams.put("institution_id", PropKit.get("institution_id"));
+		dateparams.put("remote", "2");
+		dateparams.put("page", "1");
+		dateparams.put("num", "10");
         JSONArray jsonArray = dService.getReport(dateparams);	
         for (Object object : jsonArray) {
         	try {
 			JSONObject jsonObject = JSON.parseObject(object.toString());
-		    String REPORT_ID = jsonObject.getString("REPORT_ID")==null?"":jsonObject.getString("REPORT_ID");
-			Record record = Db.use("crb").findFirst("select * from DC_PACS_REPORT where ID=?", jsonObject.getString("ID"));
-			if (record == null) {
-				Record DC_PACS_REPORT = new Record()
-						.set("ID", jsonObject.getString("ID"))
-						.set("REPORT_ID", jsonObject.getString("REPORT_ID"))
-						.set("PAT_FROM_TYPE", "门诊")
-						.set("PAT_NUM", jsonObject.getString("PAT_NUM")==null?"":jsonObject.getString("PAT_NUM"))
-						.set("TESTLIST", jsonObject.getString("TESTLIST")==null?"":jsonObject.getString("TESTLIST"))
-						.set("NAME", jsonObject.getString("NAME"))
-						.set("SEX",jsonObject.getString("SEX").contains("M")?"男":"女")
-						.set("BIRTHDAY", jsonObject.getDate("BIRTHDAY")==null?"":jsonObject.getDate("BIRTHDAY"))
-						.set("ADDRESS", jsonObject.getString("ADDRESS"))
-						.set("TEL", jsonObject.getString("TEL"))
-						.set("ORG_CODE", "371728007")
-						.set("ORG_NAME", "东明县第二人民医院")
-						.set("DEP_NAME", jsonObject.getString("DEP_NAME"))
-						.set("DEP_CODE", jsonObject.getString("DEP_CODE"))
-						.set("DUTY_DOCTOR_NAME", jsonObject.getString("DUTY_DOCTOR_NAME"))
-						.set("DUTY_DOCTOR_ID", jsonObject.getString("DUTY_DOCTOR_ID"))
-						.set("CHIEF_COMPLAINT", jsonObject.getString("CHIEF_COMPLAINT"))
-						.set("DIAGNOSIS", jsonObject.getString("DIAGNOSIS"))
-						.set("STUDY_BODYPART", jsonObject.getString("STUDY_BODYPART"))
-						.set("IMAGE_TYPE_NAME", jsonObject.getString("IMAGE_TYPE_NAME"))
-						.set("FINDING", jsonObject.getString("FINDING"))
-						.set("CONCLUSION", jsonObject.getString("CONCLUSION"))
-						.set("FLAG_DIAGNOSTIC_ACCORDANCE", "1")
-						.set("HAPPEN_TIME", jsonObject.getDate("HAPPEN_TIME"))
-//						.set("SYSTEMTIME", jsonObject.getDate("SYSTEMTIME"))
-						.set("HOSPITAL_CODE", "371728007")
-						.set("UPDATE_TIME", jsonObject.getDate("UPDATE_TIME"))
-						.set("STATE", "0");
-				Db.use("crb").save("DC_PACS_REPORT", DC_PACS_REPORT);
-				}
-			Record record2 = Db.use("crb").findFirst("select * from DC_PACS_XML where REPORT_ID=?", REPORT_ID);
-			if (record2 == null) {
-				Record DC_PACS_XML = new Record()
-						.set("REPORT_ID", REPORT_ID)
-						.set("PAT_FROM_TYPE", "门诊")
-						.set("PAT_NUM", jsonObject.getString("PAT_NUM")==null?"":jsonObject.getString("PAT_NUM"))
-						.set("ORG_CODE", "371728007")
-						.set("ORG_NAME", "东明县第二人民医院")
-						.set("REPORT_XML", jsonObject.getString("FINDING")+jsonObject.getString("CONCLUSION"))
-//						.set("SYSTEMTIME", jsonObject.getDate("SYSTEMTIME"))
-						;
-				Db.use("crb").save("DC_PACS_XML", "REPORT_ID", DC_PACS_XML);
-				}
+//		    String REPORT_ID = jsonObject.getString("REPORT_ID")==null?"":jsonObject.getString("REPORT_ID");
+			Record record = Db.use("connected").findFirst("select * from reportinfoback where studyuid=?", jsonObject.getString("studyuid"));
+			if (record != null) {
+				
+				  record.set("reviewdate", jsonObject.getString("review_datetime"))
+						.set("reportdate", jsonObject.getString("report_datetime"))
+						.set("description", jsonObject.getString("description"))
+						.set("remotetime", jsonObject.getString("req_date_time"))
+						.set("initiatordoctor", jsonObject.getString("req_doctor_name"))
+						.set("result", jsonObject.getString("report_result"))
+						.set("initiatorhospital", jsonObject.getString("local_institution_name"))
+						.set("confirmdoctor", jsonObject.getString("confirm_doctor_name"))
+						.set("remotehospital", jsonObject.getString("remote_institution_name"))
+						.set("remotedoctor", jsonObject.getString("report_doctor_name"))
+						.set("impression", jsonObject.getString("impression"))
+						.set("reviewdoctor", jsonObject.getString("review_doctor_name"))
+						.set("reportdoctor", jsonObject.getString("report_doctor_name"));
+				Db.use("connected").update("reportinfoback", "studyuid", record);				}
         	} catch (Exception e) {
 				// TODO: handle exception
         		continue;
@@ -96,7 +72,7 @@ public class CrbTask implements ITask {
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		Date date = new Date();
 		//start
-		long dInteger = date.getTime() - 1200000;
+		long dInteger = date.getTime() - 43200000;
 		String daString = sdf.format(new Date(dInteger));
 		//end
 		long eInteger = date.getTime() - 300000;