刘韬 6 years ago
parent
commit
829afd1313
1 changed files with 21 additions and 19 deletions
  1. 21 19
      DataFusion/src/com/zskk/control/ViewController.java

+ 21 - 19
DataFusion/src/com/zskk/control/ViewController.java

@@ -68,37 +68,39 @@ 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=3 and institution_id=47600001 order by createdAt desc limit 30");
 			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());
+				Record record = Db.use("connected").findFirst("select * from V_EXAMREQUESTS where studyuid=?",studies.getStudyuid());
 				if (record == 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.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());
-				if (record.getStr("FITEM_RESULT_CODE") != null) {
-					//report.setReportResult(record.getStr("FITEM_RESULT_CODE").contains("阴")?"1":"2");
-				}
-				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();
+				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.setName(record.getStr("patientname"));
+//				patientInfos.setPhone(record.getStr("phone"));
+//				patientInfos.setCardNum(record.getStr("IDCARD"));
 //				patientInfos.update();
+				exams2.setExamStatus(9);
+//				exams2.update();
+				this.renderJson(exams);
+
 			}
-			this.renderJson(examds);
 		} catch (Exception e) {
 			// TODO: handle exception
 			this.renderText(e.toString());