|
@@ -6,6 +6,8 @@ import com.jfinal.plugin.activerecord.Db;
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
import com.jfinal.plugin.cron4j.ITask;
|
|
|
import com.zskk.model.*;
|
|
|
+import com.zskk.service.ThreadPoolService;
|
|
|
+
|
|
|
import okhttp3.*;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
|
|
@@ -23,51 +25,51 @@ public class DataTask implements ITask {
|
|
|
// TODO Auto-generated method stub
|
|
|
try {
|
|
|
List<Exams> exams = Exams.dao.use("zskk").find(
|
|
|
- "SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=07100004 order by createdAt desc limit 30");
|
|
|
+ "SELECT * FROM pacsonline.exams where exam_status=3 and institution_id='07100004' order by createdAt desc limit 30");
|
|
|
for (Exams exams2 : exams) {
|
|
|
try {
|
|
|
- Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
- Record record = Db.use("connected").findFirst("select * from PACS_YYX.YUNYINGXIANG where STUDYUID=?",studies.getStudyuid());
|
|
|
+// Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
+ Record record = Db.use("connected").findFirst("select * from PACS_YYX.YUNYINGXIANG where ACCESSIONNUMBER=?",exams2.getAccessionNum());
|
|
|
if (record == null) {
|
|
|
continue;
|
|
|
}
|
|
|
Report report = new Report().use("zskk");
|
|
|
report.setId(creatId());
|
|
|
- report.setReportDatetime(parseStringToDate(record.getStr("REPORTDATE")));
|
|
|
- if (record.getStr("IMPRESSION") == null || record.getStr("DESCRIPTION") == null
|
|
|
- || record.getStr("IMPRESSION").isBlank() || record.getStr("DESCRIPTION").isBlank()) {
|
|
|
+ report.setReportDatetime(parseStringToDate(record.getStr("REPORTDT")));
|
|
|
+ if (record.getStr("DIAGNOSTICREPORT") == null || record.getStr("IMAGINGMANIFESTATION") == null
|
|
|
+ || record.getStr("DIAGNOSTICREPORT").isBlank() || record.getStr("IMAGINGMANIFESTATION").isBlank()) {
|
|
|
continue;
|
|
|
}
|
|
|
- report.setImpression(record.getStr("IMPRESSION"));
|
|
|
- report.setDescription(record.getStr("DESCRIPTION"));
|
|
|
+ report.setImpression(record.getStr("DIAGNOSTICREPORT"));
|
|
|
+ report.setDescription(record.getStr("IMAGINGMANIFESTATION"));
|
|
|
report.setExamId(exams2.getId());
|
|
|
report.setCreatedAt(new Date());
|
|
|
- report.setReportDoctorId(getDoctorIdByName(record.getStr("REPORTDOCTOR")));
|
|
|
- report.setReviewDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
|
|
|
- report.setReviewDatetime(parseStringToDate(record.getStr("REPORTDATE")));
|
|
|
- report.setConfirmDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
|
|
|
- report.setConfirmDatetime(parseStringToDate(record.getStr("REPORTDATE")));
|
|
|
+// report.setReportDoctorId(getDoctorIdByName(record.getStr("REPORTDOCTOR")));
|
|
|
+// report.setReviewDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
|
|
|
+ report.setReviewDatetime(parseStringToDate(record.getStr("REPORTDT")));
|
|
|
+// report.setConfirmDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
|
|
|
+ report.setConfirmDatetime(parseStringToDate(record.getStr("REPORTDT")));
|
|
|
report.save();
|
|
|
PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
|
|
|
patientInfos.setName(record.getStr("PATIENTNAME"));
|
|
|
- patientInfos.setPhone(record.getStr("PHONE"));
|
|
|
- patientInfos.setCardNum(record.getStr("IDCARD"));
|
|
|
+ patientInfos.setPhone(record.getStr("PHONE")==null?"":record.getStr("PHONE"));
|
|
|
+ patientInfos.setCardNum(record.getStr("IDCARD")==null?"":record.getStr("IDCARD"));
|
|
|
patientInfos.update();
|
|
|
exams2.setExamStatus(9);
|
|
|
//exams2.setClinDoctors(record.getStr("CLINICALDOCTOR"));
|
|
|
- exams2.setApplicationDepartment(record.getStr("DEPARTMENT"));
|
|
|
- exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
|
|
|
+// exams2.setApplicationDepartment(record.getStr("DEPARTMENT"));
|
|
|
+// exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
|
|
|
//exams2.setClinDiag(record.getStr("CLINICALDOCTOR"));
|
|
|
exams2.update();
|
|
|
- /* // 传云医康 数据
|
|
|
+ // 传云医康 数据
|
|
|
Map<String, String> data = new HashMap<String, String>();
|
|
|
// 获取data数据
|
|
|
// 医院id
|
|
|
data.put("hospital_id", "07100004");
|
|
|
// 影像所见
|
|
|
- data.put("description", record.getStr("DESCRIPTION"));
|
|
|
+ data.put("description", record.getStr("IMAGINGMANIFESTATION"));
|
|
|
// 意见建议
|
|
|
- data.put("impression", record.getStr("IMPRESSION"));
|
|
|
+ data.put("impression", record.getStr("DIAGNOSTICREPORT"));
|
|
|
// 检查id
|
|
|
data.put("exam_id", exams2.getId());
|
|
|
data.put("study_id", exams2.getStudyId());
|
|
@@ -76,40 +78,42 @@ public class DataTask implements ITask {
|
|
|
// 患者姓名
|
|
|
data.put("patient_name", record.getStr("PATIENTNAME"));
|
|
|
// 患者性别
|
|
|
- data.put("patient_sex", record.getStr("PATIENTSEX").equals("女") ? "F" : "M");
|
|
|
+ data.put("patient_sex", patientInfos.getSex());
|
|
|
// 身份证号
|
|
|
- data.put("card_num", "");
|
|
|
+ data.put("card_num", patientInfos.getCardNum());
|
|
|
// 手机号
|
|
|
- data.put("phone", "");
|
|
|
+ data.put("phone", patientInfos.getPhone());
|
|
|
// 患者生日
|
|
|
- data.put("birthday", returnSecondTimestamp(record.getStr("BIRTHDATE")));
|
|
|
+ data.put("birthday", patientInfos.getBirthday());
|
|
|
// 患者检查时年龄
|
|
|
- data.put("patient_age", record.getStr("PATIENTAGE"));
|
|
|
+ data.put("patient_age", patientInfos.getAge());
|
|
|
// 阴阳性 1阴性 2阳性
|
|
|
data.put("report_result", "");
|
|
|
// 报告时间 10位时间戳
|
|
|
- data.put("report_datetime", returnSecondTimestamp(record.getStr("REPORTDATE")));
|
|
|
+ data.put("report_datetime", returnSecondTimestamp(record.getStr("REPORTDT")));
|
|
|
// 报告医生id
|
|
|
- data.put("report_doctor_id", record.getStr("REPORTDOCTOR"));
|
|
|
+ data.put("report_doctor_id", "");
|
|
|
// 报告医生姓名
|
|
|
- data.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
|
|
|
+ data.put("report_doctor_name", "");
|
|
|
// 审核时间
|
|
|
- data.put("review_datetime", returnSecondTimestamp(record.getStr("REPORTDATE")));
|
|
|
+ data.put("review_datetime", returnSecondTimestamp(record.getStr("REPORTDT")));
|
|
|
// 审核医生id
|
|
|
- data.put("review_doctor_id", record.getStr("REPORTDOCTOR"));
|
|
|
+ data.put("review_doctor_id", "");
|
|
|
// 审核姓名
|
|
|
- data.put("review_doctor_name", record.getStr("REPORTDOCTOR"));
|
|
|
+ data.put("review_doctor_name", "");
|
|
|
// 确认时间
|
|
|
- data.put("confirm_datetime", returnSecondTimestamp(record.getStr("REPORTDATE")));
|
|
|
+ data.put("confirm_datetime", returnSecondTimestamp(record.getStr("REPORTDT")));
|
|
|
// 确认医生id
|
|
|
- data.put("confirm_doctor_id", record.getStr("REPORTDOCTOR"));
|
|
|
+ data.put("confirm_doctor_id", "");
|
|
|
// 确认医生姓名
|
|
|
- data.put("confirm_doctor_name", record.getStr("REPORTDOCTOR"));
|
|
|
+ data.put("confirm_doctor_name", "");
|
|
|
|
|
|
ThreadPoolService tService = new com.zskk.service.ThreadPoolService();
|
|
|
tService.execute(() -> {
|
|
|
String dadaString = JSON.toJSONString(data);
|
|
|
- dadaString = dadaString.replace("\\", "");
|
|
|
+ dadaString = dadaString.replace("\\n", "");
|
|
|
+ dadaString = dadaString.replace("\\r", "");
|
|
|
+
|
|
|
Map maps = (Map) JSON.parse(dadaString);
|
|
|
try {
|
|
|
post(null, maps);
|
|
@@ -117,7 +121,7 @@ public class DataTask implements ITask {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
// TODO: handle exception
|
|
@@ -249,7 +253,7 @@ public class DataTask implements ITask {
|
|
|
}
|
|
|
name = name.replace(" ", "");
|
|
|
Doctors doctors = Doctors.dao.use("zskk").findFirst(
|
|
|
- "SELECT * FROM doctors where instr(?,realname) and institution_id=15700002 and realname <>''", name);
|
|
|
+ "SELECT * FROM doctors where instr(?,realname) and institution_id='15700002' and realname <>''", name);
|
|
|
if (doctors == null) {
|
|
|
Doctors newDoctors = new Doctors().use("zskk");
|
|
|
newDoctors.setId(creatId());
|