|
@@ -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;
|