|
@@ -3,6 +3,7 @@ package com.zskk.task;
|
|
|
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,37 +22,34 @@ public class ReviewTask implements ITask {
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
- JSONArray jsonArray = dService.getExamList(80);
|
|
|
- for (Object object : jsonArray) {
|
|
|
+ List<Record> records = Db.use("connected").find("select top 50 * from reportinfo where reviewdate >? order by reviewdate desc",parseStringToDate());
|
|
|
+ for (Record record : records) {
|
|
|
try {
|
|
|
- JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
- Record record = Db.use("connected").findFirst("select * from reportinfo where examNo=?",
|
|
|
- jsonObject.getString("patient_num"));
|
|
|
|
|
|
if (record.getStr("description") == null && record.getStr("impression") == null) {
|
|
|
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("type", "2");
|
|
|
|
|
|
params.put("institution_id", PropKit.get("institution_id"));
|
|
|
|
|
|
- params.put("code", jsonObject.getString("id"));
|
|
|
+ params.put("code", record.getStr("examNo"));
|
|
|
// 报告医生姓名
|
|
|
params.put("report_doctor_name", record.getStr("reportdoctor"));
|
|
|
// 报告时间
|
|
|
- params.put("report_datetime", parseStringToDate(record.getStr("reportdate")));
|
|
|
+ params.put("report_datetime", record.getStr("reportdate"));
|
|
|
// 审核医生姓名
|
|
|
params.put("review_doctor_name",
|
|
|
record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
|
|
|
// 审核时间
|
|
|
- params.put("review_datetime", parseStringToDate(record.getStr("reviewdate")));
|
|
|
+ params.put("review_datetime", record.getStr("reviewdate"));
|
|
|
// 确认医生姓名
|
|
|
params.put("confirm_doctor_name",
|
|
|
record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
|
|
|
// 确认时间
|
|
|
- params.put("confirm_datetime", parseStringToDate(record.getStr("reviewdate")));
|
|
|
+ params.put("confirm_datetime", record.getStr("reviewdate"));
|
|
|
// 意见建议
|
|
|
params.put("impression", record.getStr("impression"));
|
|
|
// 影像所见
|
|
@@ -106,15 +104,12 @@ public class ReviewTask implements ITask {
|
|
|
* @param dateStr
|
|
|
* @return
|
|
|
*/
|
|
|
- private String parseStringToDate(String dateStr) {
|
|
|
- if (dateStr == null) {
|
|
|
- SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- Date date = new Date();
|
|
|
- String timeString = null;
|
|
|
- timeString = sdf2.format(date);
|
|
|
- return timeString;
|
|
|
- }
|
|
|
- return dateStr;
|
|
|
+ private String parseStringToDate() {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date date = new Date();
|
|
|
+ long dInteger = date.getTime() - 1800000;
|
|
|
+ String daString = sdf.format(new Date(dInteger));
|
|
|
+ return daString;
|
|
|
}
|
|
|
|
|
|
}
|