|
@@ -22,54 +22,6 @@ 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=81069902 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 PACSONLINE_Interface 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("IMPRESSION"));
|
|
|
- report.setDescription(record.getStr("DESCRIPTION"));
|
|
|
- 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.save();
|
|
|
- PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
|
|
|
- patientInfos.setName(record.getStr("PATIENTNAME"));
|
|
|
-// patientInfos.setPhone(record.getStr("telephone"));
|
|
|
- patientInfos.setCardNum(record.getStr("IDCARD"));
|
|
|
- patientInfos.update();
|
|
|
- exams2.setExamStatus(9);
|
|
|
- exams2.setApplicationDepartment(record.getStr("DEPARTMENT"));
|
|
|
- exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
|
|
|
- exams2.update();
|
|
|
-
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- // TODO: handle exception
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- // TODO: handle exception
|
|
|
-
|
|
|
- }
|
|
|
-=======
|
|
|
DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
JSONArray jsonArray = dService.getExamList(30);
|
|
|
for (Object object : jsonArray) {
|
|
@@ -108,11 +60,11 @@ public class DataTask implements ITask {
|
|
|
params.put("clin_diag", "");
|
|
|
//patient_infos表
|
|
|
//患者姓名
|
|
|
- params.put("name",record.getStr("patientname"));
|
|
|
+ params.put("name",record.getStr("PATIENTNAME"));
|
|
|
//患者手机号
|
|
|
params.put("phone", "");
|
|
|
//患者身份证号
|
|
|
- params.put("card_num", "");
|
|
|
+ params.put("card_num", record.getStr("IDCARD"));
|
|
|
params.put("report_result", "1");
|
|
|
ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
tService.execute(() -> {
|
|
@@ -128,32 +80,6 @@ public class DataTask implements ITask {
|
|
|
|
|
|
}
|
|
|
|
|
|
- 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=81069902 and realname<>''", name);
|
|
|
- if (doctors == null) {
|
|
|
- Doctors newDoctors = new Doctors().use("zskk");
|
|
|
- newDoctors.setId(creatId());
|
|
|
- newDoctors.setUsername("none");
|
|
|
- newDoctors.setRealname(name);
|
|
|
- newDoctors.setPassword("123456");
|
|
|
- newDoctors.setInstitutionId("81069902");
|
|
|
- newDoctors.setCreatedAt(new Date());
|
|
|
- newDoctors.setUpdatedAt(new Date());
|
|
|
- newDoctors.save();
|
|
|
- return newDoctors.getId();
|
|
|
- }
|
|
|
- return doctors.getId();
|
|
|
- }
|
|
|
-
|
|
|
private Date parseStringToDate(String dateStr) {
|
|
|
if (dateStr == null) {
|
|
|
return new Date();
|