|
@@ -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;
|
|
@@ -25,12 +26,34 @@ public class DataTask implements ITask {
|
|
|
for (Object object : jsonArray) {
|
|
|
try {
|
|
|
JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
- Record record = Db.use("connected").findFirst("select * from reportinfo where examNo=?",
|
|
|
- jsonObject.getString("patient_num"));
|
|
|
- if (record == null) {
|
|
|
+ List<Record> record_accnum = Db.use("connected").find("select * from reportinfo where accessionNumber=?",
|
|
|
+ jsonObject.getString("accession_num"));
|
|
|
+ Record record = null;
|
|
|
+ //所见
|
|
|
+ String desString = "";
|
|
|
+ //建议
|
|
|
+ String impString = "";
|
|
|
+ //项目
|
|
|
+ String proString = "";
|
|
|
+ if (record_accnum.size() == 1) {
|
|
|
+ record = record_accnum.get(0);
|
|
|
+ desString = desString + record.getStr("description");
|
|
|
+ impString = impString + record.getStr("impression");
|
|
|
+ proString = proString + record.getStr("project");
|
|
|
+ }else if (record_accnum.size() > 1) {
|
|
|
+ record = record_accnum.get(0);
|
|
|
+ for (Record countRecord : record_accnum) {
|
|
|
+ desString = desString + countRecord.getStr("description") + "\\r\\n";
|
|
|
+ impString = impString + countRecord.getStr("impression") + "\\r\\n";
|
|
|
+ proString = proString + countRecord.getStr("project") + ";";
|
|
|
+ }
|
|
|
+ }else {
|
|
|
continue;
|
|
|
}
|
|
|
- if (record.getStr("description") == null && record.getStr("impression") == null) {
|
|
|
+// Record record = Db.use("connected").findFirst("select * from reportinfo where examNo=?",
|
|
|
+// jsonObject.getString("patient_num"));
|
|
|
+
|
|
|
+ if (desString == "" && impString == "") {
|
|
|
continue;
|
|
|
}
|
|
|
if (record.getStr("department").equals("健康体检科")) {
|
|
@@ -67,9 +90,9 @@ public class DataTask implements ITask {
|
|
|
// 确认时间
|
|
|
params.put("confirm_datetime", record.getStr("reviewdate"));
|
|
|
// 意见建议
|
|
|
- params.put("impression", record.getStr("impression"));
|
|
|
+ params.put("impression", impString);
|
|
|
// 影像所见
|
|
|
- params.put("description", record.getStr("description"));
|
|
|
+ params.put("description", desString);
|
|
|
// exams表
|
|
|
// 申请科室
|
|
|
params.put("application_department", record.getStr("department"));
|
|
@@ -99,7 +122,7 @@ public class DataTask implements ITask {
|
|
|
// 病人ID
|
|
|
params.put("his_patient_id", record.getStr("patientid") == null ? "" : record.getStr("patientid"));
|
|
|
// 检查方法
|
|
|
- params.put("exam_project", record.getStr("project"));
|
|
|
+ params.put("exam_project", proString);
|
|
|
ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
tService.execute(() -> {
|
|
|
dService.saveReport(params);
|