|
@@ -1,45 +1,83 @@
|
|
package com.zskk.task;
|
|
package com.zskk.task;
|
|
|
|
|
|
-import java.text.ParseException;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
import com.jfinal.plugin.cron4j.ITask;
|
|
import com.jfinal.plugin.cron4j.ITask;
|
|
-import com.zskk.service.ServiceFactory;
|
|
|
|
import com.zskk.model.Doctors;
|
|
import com.zskk.model.Doctors;
|
|
-import com.zskk.model.PatientInfos;
|
|
|
|
-import com.zskk.model.Report;
|
|
|
|
-import com.zskk.model.Studies;
|
|
|
|
-import com.zskk.service.WeixinService;
|
|
|
|
import com.zskk.model.Exams;
|
|
import com.zskk.model.Exams;
|
|
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.*;
|
|
|
|
+
|
|
|
|
+import static com.zskk.task.SendPostUtil.sendPost;
|
|
|
|
|
|
-public class DataTask implements ITask {
|
|
|
|
|
|
|
|
|
|
+public class DataTask implements ITask {
|
|
|
|
+ //请求路径
|
|
|
|
+ public final static String url = "https://risserver3.pacsonline.cn/butt/getExam/butt/getExam";
|
|
|
|
+ public final static String url_ = "https://risserver3.pacsonline.cn/butt/getExam/butt/saveReport";
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
// TODO Auto-generated method stub
|
|
// TODO Auto-generated method stub
|
|
try {
|
|
try {
|
|
- List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=46400001 order by createdAt desc limit 50");
|
|
|
|
- for (Exams exams2 : exams) {
|
|
|
|
|
|
+ //List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=46400001 order by createdAt desc limit 50");
|
|
|
|
+ String s=sendPost(url, "institution_id", "13000003");
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
|
+ String data = jsonObject.getString("data");
|
|
|
|
+ List<Exams> exams = JSONArray.parseArray(data,Exams.class);
|
|
|
|
+ for (Exams exams2 : exams) {
|
|
try {
|
|
try {
|
|
-
|
|
|
|
-
|
|
|
|
// Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
// Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
Record record = Db.use("connected").findFirst("select * from hhris.view_reportinfo where ACCESSIONNUMBER=?",exams2.getAccessionNum());
|
|
Record record = Db.use("connected").findFirst("select * from hhris.view_reportinfo where ACCESSIONNUMBER=?",exams2.getAccessionNum());
|
|
if (record == null) {
|
|
if (record == null) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- Report report = new Report().use("zskk");
|
|
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
|
+ //exams表
|
|
|
|
+ params.put("exam_id",exams2.getId());
|
|
|
|
+ //报告医生姓名
|
|
|
|
+ params.put("report_doctor_name",record.getStr("REPORTDOCTOR"));
|
|
|
|
+ //报告时间
|
|
|
|
+ params.put("report_datetime",record.getStr("REPORTDATE"));
|
|
|
|
+ //审核医生姓名
|
|
|
|
+ params.put("review_doctor_name",record.getStr("REVIEWDOCTOR"));
|
|
|
|
+ //审核时间
|
|
|
|
+ params.put("review_datetime",record.getStr("REPORTDATE"));
|
|
|
|
+ //确认医生姓名
|
|
|
|
+ params.put("confirm_doctor_name","");
|
|
|
|
+ //确认时间
|
|
|
|
+ params.put("confirm_datetime","");
|
|
|
|
+ if (record.getStr("IMPRESSION") == null && record.getStr("DESCRIPTION") == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //意见建议
|
|
|
|
+ params.put("impression",record.getStr("IMPRESSION"));
|
|
|
|
+ //影像所见
|
|
|
|
+ params.put("description",record.getStr("DESCRIPTION"));
|
|
|
|
+ //exams表
|
|
|
|
+ //申请科室
|
|
|
|
+ params.put("application_department","");
|
|
|
|
+ //申请医生
|
|
|
|
+ params.put("application_doctor","");
|
|
|
|
+ //临床诊断
|
|
|
|
+ params.put("clin_diag","");
|
|
|
|
+ //patient_infos表
|
|
|
|
+ //患者姓名
|
|
|
|
+ params.put("name",record.getStr("PATIENTNAME"));
|
|
|
|
+ //患者手机号
|
|
|
|
+ params.put("phone",record.getStr("PHONE"));
|
|
|
|
+ //患者身份证号
|
|
|
|
+ params.put("card_num",record.getStr("IDCARD"));
|
|
|
|
+ sendPost(url_, params);
|
|
|
|
+
|
|
|
|
+ /* Report report = new Report().use("zskk");
|
|
report.setId(creatId());
|
|
report.setId(creatId());
|
|
- report.setReportDatetime(parseStringToDate(record.getStr("REPORTDATE")));
|
|
|
|
- if (record.getStr("IMPRESSION") == null && record.getStr("DESCRIPTION") == null) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- report.setImpression(new String(record.getStr("IMPRESSION").getBytes("windows-1252"),"GBK"));
|
|
|
|
|
|
+ report.setReportDatetime(parseStringToDate(record.getStr("REPORTDATE")));*/
|
|
|
|
+
|
|
|
|
+ /*report.setImpression(new String(record.getStr("IMPRESSION").getBytes("windows-1252"),"GBK"));
|
|
report.setDescription(new String(record.getStr("DESCRIPTION").getBytes("windows-1252"),"GBK"));
|
|
report.setDescription(new String(record.getStr("DESCRIPTION").getBytes("windows-1252"),"GBK"));
|
|
report.setExamId(exams2.getId());
|
|
report.setExamId(exams2.getId());
|
|
report.setCreatedAt(new Date());
|
|
report.setCreatedAt(new Date());
|
|
@@ -47,14 +85,14 @@ public class DataTask implements ITask {
|
|
report.setReviewDoctorId(getDoctorIdByName(new String(record.getStr("REVIEWDOCTOR").getBytes("windows-1252"),"GBK")));
|
|
report.setReviewDoctorId(getDoctorIdByName(new String(record.getStr("REVIEWDOCTOR").getBytes("windows-1252"),"GBK")));
|
|
report.setReviewDatetime(parseStringToDate(new String(record.getStr("REPORTDATE").getBytes("windows-1252"),"GBK")));
|
|
report.setReviewDatetime(parseStringToDate(new String(record.getStr("REPORTDATE").getBytes("windows-1252"),"GBK")));
|
|
report.setConfirmDoctorId(getDoctorIdByName(new String(record.getStr("REVIEWDOCTOR").getBytes("windows-1252"),"GBK")));
|
|
report.setConfirmDoctorId(getDoctorIdByName(new String(record.getStr("REVIEWDOCTOR").getBytes("windows-1252"),"GBK")));
|
|
- report.setConfirmDatetime(parseStringToDate(new String(record.getStr("REPORTDATE").getBytes("windows-1252"),"GBK")));
|
|
|
|
- report.save();
|
|
|
|
- PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
|
|
|
|
- patientInfos.setName(new String(record.getStr("PATIENTNAME").getBytes("windows-1252"),"GBK"));
|
|
|
|
|
|
+ report.setConfirmDatetime(parseStringToDate(new String(record.getStr("REPORTDATE").getBytes("windows-1252"),"GBK")));*/
|
|
|
|
+ //report.save();
|
|
|
|
+ //PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
|
|
|
|
+ //patientInfos.setName(new String(record.getStr("PATIENTNAME").getBytes("windows-1252"),"GBK"));
|
|
// patientInfos.setPhone(record.getStr("PHONE"));
|
|
// patientInfos.setPhone(record.getStr("PHONE"));
|
|
// patientInfos.setCardNum(record.getStr("IDCARD"));
|
|
// patientInfos.setCardNum(record.getStr("IDCARD"));
|
|
- patientInfos.update();
|
|
|
|
- try {
|
|
|
|
|
|
+// patientInfos.update();
|
|
|
|
+ /* try {
|
|
exams2.setClinDoctors(new String(record.getStr("CLINICALDOCTOR").getBytes("windows-1252"),"GBK"));
|
|
exams2.setClinDoctors(new String(record.getStr("CLINICALDOCTOR").getBytes("windows-1252"),"GBK"));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
// TODO: handle exception
|
|
// TODO: handle exception
|
|
@@ -62,7 +100,7 @@ public class DataTask implements ITask {
|
|
exams2.setExamStatus(9);
|
|
exams2.setExamStatus(9);
|
|
exams2.update();
|
|
exams2.update();
|
|
WeixinService wService = new WeixinService();
|
|
WeixinService wService = new WeixinService();
|
|
- wService.requestWeixinQrcode(report.getId());
|
|
|
|
|
|
+ wService.requestWeixinQrcode(report.getId());*/
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
// TODO: handle exception
|
|
// TODO: handle exception
|
|
continue;
|
|
continue;
|