|
@@ -1,22 +1,5 @@
|
|
|
package com.zskk.task;
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
-import com.jfinal.plugin.activerecord.Db;
|
|
|
-import com.jfinal.plugin.activerecord.Record;
|
|
|
-import com.jfinal.plugin.cron4j.ITask;
|
|
|
-import com.zskk.service.ServiceFactory;
|
|
|
-import com.zskk.model.Doctors;
|
|
|
-import com.zskk.model.Exams;
|
|
|
-import com.zskk.model.PatientInfos;
|
|
|
-import com.zskk.model.Report;
|
|
|
-import com.zskk.model.Studies;
|
|
|
-import com.zskk.service.WeixinService;
|
|
|
-=======
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -28,60 +11,17 @@ import com.jfinal.plugin.cron4j.ITask;
|
|
|
import com.zskk.service.DataService;
|
|
|
import com.zskk.service.ServiceFactory;
|
|
|
import com.zskk.service.ThreadPoolService;
|
|
|
->>>>>>> origin/master
|
|
|
|
|
|
public class DataTask implements ITask {
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
-<<<<<<< HEAD
|
|
|
- try {
|
|
|
- List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=73090001 order by createdAt desc limit 50");
|
|
|
- for (Exams exams2 : exams) {
|
|
|
- Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
- Record record = Db.use("connected").findFirst("select * from caller where STUDYUID=?",studies.getStudyuid());
|
|
|
- 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) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- report.setImpression(record.getStr("DESCRIPTION"));
|
|
|
- report.setDescription(record.getStr("IMPRESSION"));
|
|
|
- report.setExamId(exams2.getId());
|
|
|
- report.setCreatedAt(new Date());
|
|
|
- if (record.getStr("FITEM_RESULT_CODE") != null) {
|
|
|
- report.setReportResult(record.getStr("FITEM_RESULT_CODE").contains("阳")?"2":"1");
|
|
|
- }
|
|
|
- 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.save();
|
|
|
- PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
|
|
|
- patientInfos.setName(record.getStr("PATIENTNAME"));
|
|
|
- patientInfos.setPhone(record.getStr("PHONE"));
|
|
|
- patientInfos.update();
|
|
|
- exams2.setExamStatus(9);
|
|
|
- exams2.update();
|
|
|
- WeixinService wService = new WeixinService();
|
|
|
- wService.requestWeixinQrcode(report.getId());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- // TODO: handle exception
|
|
|
- }
|
|
|
-
|
|
|
-=======
|
|
|
DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
JSONArray jsonArray = dService.getExamList(30);
|
|
|
for (Object object : jsonArray) {
|
|
|
JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
- Record record = Db.use("connected").findFirst("select * from PACSONLINE_Interface where STUDYUID=?", jsonObject.getString("studyuid"));
|
|
|
+ Record record = Db.use("connected").findFirst("select * from caller where STUDYUID=?", jsonObject.getString("studyuid"));
|
|
|
if (record == null) {
|
|
|
continue;
|
|
|
}
|
|
@@ -91,7 +31,7 @@ public class DataTask implements ITask {
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
params.put("exam_id", jsonObject.getString("id"));
|
|
|
//报告医生姓名
|
|
|
- params.put("report_doctor_name",record.getStr("REPORTDOCTOR"));
|
|
|
+ params.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
|
|
|
//报告时间
|
|
|
params.put("report_datetime",record.getStr("REPORTDATE"));
|
|
|
//审核医生姓名
|
|
@@ -108,64 +48,30 @@ public class DataTask implements ITask {
|
|
|
params.put("description",record.getStr("DESCRIPTION"));
|
|
|
//exams表
|
|
|
//申请科室
|
|
|
- params.put("application_department", record.getStr("DEPARTMENT"));
|
|
|
+ params.put("application_department", "");
|
|
|
//申请医生
|
|
|
- params.put("application_doctor", record.getStr("CLINICALDOCTOR"));
|
|
|
+ params.put("application_doctor", "");
|
|
|
//临床诊断
|
|
|
params.put("clin_diag", "");
|
|
|
//patient_infos表
|
|
|
//患者姓名
|
|
|
params.put("name",record.getStr("PATIENTNAME"));
|
|
|
//患者手机号
|
|
|
- params.put("phone", "");
|
|
|
+ params.put("phone", record.getStr("PHONE"));
|
|
|
//患者身份证号
|
|
|
- params.put("card_num", record.getStr("IDCARD"));
|
|
|
- params.put("report_result", "1");
|
|
|
+ params.put("card_num", "");
|
|
|
+ params.put("report_result", record.getStr("FITEM_RESULT_CODE").contains("阳")?"2":"1");
|
|
|
ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
tService.execute(() -> {
|
|
|
dService.saveReport(params);
|
|
|
});
|
|
|
}
|
|
|
->>>>>>> origin/master
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public void stop() {
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- private String creatId() {
|
|
|
- UUID id=UUID.randomUUID();
|
|
|
- String[] idd=id.toString().split("-");
|
|
|
- return idd[0]+idd[1]+idd[2];
|
|
|
- }
|
|
|
-
|
|
|
- private String getDoctorIdByName(String name) {
|
|
|
- if (name == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- Doctors doctors = Doctors.dao.use("zskk").findFirst("SELECT * FROM doctors where instr(?,realname) and institution_id=73090001",name);
|
|
|
- if (doctors == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return doctors.getId();
|
|
|
- }
|
|
|
-
|
|
|
- private Date parseStringToDate(String dateStr) {
|
|
|
- if (dateStr == null) {
|
|
|
- return new Date();
|
|
|
- }
|
|
|
- SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- Date date = null;
|
|
|
- try {
|
|
|
- date = sdf.parse(dateStr);
|
|
|
- } catch (ParseException e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- return date;
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
}
|