|
@@ -4,6 +4,7 @@ import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -21,43 +22,66 @@ public class BackTask implements ITask {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
- DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
- Map<String, String> params = new HashMap<>();
|
|
|
- //报告状态
|
|
|
- params.put("report_status", "9");
|
|
|
- //医疗机构ID
|
|
|
- params.put("institution_id", PropKit.get("institution_id"));
|
|
|
- //时间段
|
|
|
- params.put("time", parseStringToDate());
|
|
|
+ List<Record> records = Db.use("local").find("select * from report where status=1");
|
|
|
+ for (Record record : records) {
|
|
|
+ Record recordfind = Db.use("connected").findFirst("select * from PAB1 where PAA01=?", record.getStr("accession_num"));
|
|
|
+ if (recordfind == null) {
|
|
|
+ Record recordnew = new Record();
|
|
|
+ recordnew.set("PAA01", record.getStr("accession_num"));
|
|
|
+ recordnew.set("PAB10", record.getStr("description"));
|
|
|
+ recordnew.set("PAB11", record.getStr("impression"));
|
|
|
+ recordnew.set("PAB13", record.getStr("review_datetime"));
|
|
|
+ recordnew.set("PAB17", record.getStr("report_datetime"));
|
|
|
+ recordnew.set("PAB15", "326");
|
|
|
+ recordnew.set("BCE03", record.getStr("review_doctor_name"));
|
|
|
+ recordnew.set("PAB20", "否");
|
|
|
+ recordnew.set("BCE01", "256");
|
|
|
+// Db.use("connected").save("PAB1", recordnew);
|
|
|
|
|
|
- JSONArray jsonArray = dService.getReport(params);
|
|
|
- for (Object object : jsonArray) {
|
|
|
- JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
- Record recordfind = Db.use("local").findFirst("select * from report where studyuid=?", jsonObject.getString("studyuid"));;
|
|
|
- if (recordfind != null) {
|
|
|
- continue;
|
|
|
+ //更新状态
|
|
|
+ record.set("status", 2);
|
|
|
+ Db.use("local").update("report", record);
|
|
|
}
|
|
|
- Record record = new Record();
|
|
|
- record.set("name", jsonObject.getString("name"));
|
|
|
- record.set("sex", jsonObject.getString("sex"));
|
|
|
- record.set("phone", jsonObject.getString("phone"));
|
|
|
- record.set("card_num", jsonObject.getString("card_num"));
|
|
|
- record.set("hopitalized_no", jsonObject.getString("hopitalized_no"));
|
|
|
- record.set("out_patient", jsonObject.getString("out_patient"));
|
|
|
- record.set("accession_num", jsonObject.getString("accession_num"));
|
|
|
- record.set("patient_num", jsonObject.getString("patient_num"));
|
|
|
- record.set("studyuid", jsonObject.getString("studyuid"));
|
|
|
- record.set("his_patient_id", jsonObject.getString("his_patient_id"));
|
|
|
- record.set("impression", jsonObject.getString("impression"));
|
|
|
- record.set("description", jsonObject.getString("description"));
|
|
|
- record.set("report_datetime", jsonObject.getString("report_datetime"));
|
|
|
- record.set("report_doctor_name", jsonObject.getString("report_doctor_name"));
|
|
|
- record.set("review_doctor_name", jsonObject.getString("review_doctor_name"));
|
|
|
- record.set("review_datetime", jsonObject.getString("review_datetime"));
|
|
|
- record.set("report_result", jsonObject.getString("report_result"));
|
|
|
- record.set("status", 1);
|
|
|
- Db.use("local").save("report", record);
|
|
|
}
|
|
|
+//
|
|
|
+//
|
|
|
+// DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
+// Map<String, String> params = new HashMap<>();
|
|
|
+// //报告状态
|
|
|
+// params.put("report_status", "9");
|
|
|
+// //医疗机构ID
|
|
|
+// params.put("institution_id", PropKit.get("institution_id"));
|
|
|
+// //时间段
|
|
|
+// params.put("time", parseStringToDate());
|
|
|
+//
|
|
|
+// JSONArray jsonArray = dService.getReport(params);
|
|
|
+// for (Object object : jsonArray) {
|
|
|
+// JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
+// Record recordfind = Db.use("local").findFirst("select * from report where studyuid=?", jsonObject.getString("studyuid"));;
|
|
|
+// if (recordfind != null) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// Record record = new Record();
|
|
|
+// record.set("name", jsonObject.getString("name"));
|
|
|
+// record.set("sex", jsonObject.getString("sex"));
|
|
|
+// record.set("phone", jsonObject.getString("phone"));
|
|
|
+// record.set("card_num", jsonObject.getString("card_num"));
|
|
|
+// record.set("hopitalized_no", jsonObject.getString("hopitalized_no"));
|
|
|
+// record.set("out_patient", jsonObject.getString("out_patient"));
|
|
|
+// record.set("accession_num", jsonObject.getString("accession_num"));
|
|
|
+// record.set("patient_num", jsonObject.getString("patient_num"));
|
|
|
+// record.set("studyuid", jsonObject.getString("studyuid"));
|
|
|
+// record.set("his_patient_id", jsonObject.getString("his_patient_id"));
|
|
|
+// record.set("impression", jsonObject.getString("impression"));
|
|
|
+// record.set("description", jsonObject.getString("description"));
|
|
|
+// record.set("report_datetime", jsonObject.getString("report_datetime"));
|
|
|
+// record.set("report_doctor_name", jsonObject.getString("report_doctor_name"));
|
|
|
+// record.set("review_doctor_name", jsonObject.getString("review_doctor_name"));
|
|
|
+// record.set("review_datetime", jsonObject.getString("review_datetime"));
|
|
|
+// record.set("report_result", jsonObject.getString("report_result"));
|
|
|
+// record.set("status", 1);
|
|
|
+// Db.use("local").save("report", record);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|