|
@@ -44,37 +44,18 @@ public class ViewController extends Controller {
|
|
|
|
|
|
public void testTask() {
|
|
|
try {
|
|
|
- //List<Record> d = Db.use("connected").find(this.getPara("sqlStr"));
|
|
|
- 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");
|
|
|
- List<Record> examds = new ArrayList<>();
|
|
|
+ List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=7 or exam_status=9 and institution_id=74300003 order by createdAt desc limit 100");
|
|
|
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) {
|
|
|
+ Report report = Report.dao.use("zskk").findFirst("select * from report where exam_id = ?",exams2.getId());
|
|
|
+ if (report == null) {
|
|
|
continue;
|
|
|
}
|
|
|
- examds.add(record);
|
|
|
- Report report = new Report().use("zskk");
|
|
|
- report.setId(creatId());
|
|
|
- report.setReportDatetime(aaa(record.getStr("REPORTDATE")));
|
|
|
- report.setImpression(record.getStr("IMPRESSION"));
|
|
|
- report.setDescription(record.getStr("DESCRIPTION"));
|
|
|
- report.setExamId(exams2.getId());
|
|
|
- report.setCreatedAt(new Date());
|
|
|
- if (record.getStr("FITEM_RESULT_CODE") != null) {
|
|
|
- //report.setReportResult(record.getStr("FITEM_RESULT_CODE").contains("阴")?"1":"2");
|
|
|
+ if (report.getReportDoctorId() == null) {
|
|
|
+ Record record = Db.use("connected").findFirst("select * from reportinfo where patientid=?",exams2.getPatientNum());
|
|
|
+ report.setReportDoctorId(getDoctorIdByName(record.getStr("reportDoctor")));
|
|
|
+ report.update();
|
|
|
}
|
|
|
- report.setReportDoctorId(getDoctorIdByName(record.getStr("REPORTDOCTOR")));
|
|
|
- report.setReviewDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
|
|
|
- report.setReviewDatetime(aaa(record.getStr("REPORTDATE")));
|
|
|
- report.setConfirmDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
|
|
|
- report.setConfirmDatetime(aaa(record.getStr("REPORTDATE")));
|
|
|
-// report.save();
|
|
|
- PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
|
|
|
- patientInfos.setName(record.getStr("PATIENTNAME"));
|
|
|
-// patientInfos.update();
|
|
|
}
|
|
|
- this.renderJson(examds);
|
|
|
} catch (Exception e) {
|
|
|
// TODO: handle exception
|
|
|
this.renderText(e.toString());
|