刘韬 5 anos atrás
pai
commit
e0f23a1470
1 arquivos alterados com 35 adições e 33 exclusões
  1. 35 33
      DataFusion/src/com/zskk/control/ViewController.java

+ 35 - 33
DataFusion/src/com/zskk/control/ViewController.java

@@ -51,50 +51,52 @@ public class ViewController extends Controller {
 
 			List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=44000003 order by createdAt desc limit 100");
 			for (Exams exams2 : exams) {
+				try {
 				Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
 				Record recordTemp = Db.use("connected").findFirst("select * from v_all_img_idx@PACSINTERFACE where F_STU_UID=?",studies.getStudyuid());
 				if (recordTemp == null) {
 					continue;
 				}
-				Record record;
-				try {
-					record = Db.use("connected").findFirst("select * from yxjK where STUDYUID=?",recordTemp.getStr("F_STU_NO"));
+				 
+				
+				Record record = Db.use("connected").findFirst("select * from yxjK where STUDYUID=?",recordTemp.getStr("F_STU_NO"));
 
-				} catch (Exception e) {
-					// TODO: handle exception
+				
+				if (record == null) {
 					continue;
 				}
-				if (record == null) {
+				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 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("PHONE")==null?"":record.getStr("PHONE"));
-//				patientInfos.setCardNum(record.getStr("IDCARD")==null?"":record.getStr("IDCARD"));
-//				patientInfos.update();
-//				exams2.setApplicationDepartment(record.getStr("DEPATMENT"));
-//				exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
-//				exams2.setExamStatus(9);
-//				exams2.update();
+				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("PHONE")==null?"":record.getStr("PHONE"));
+				patientInfos.setCardNum(record.getStr("IDCARD")==null?"":record.getStr("IDCARD"));
+				patientInfos.update();
+				exams2.setApplicationDepartment(record.getStr("DEPATMENT"));
+				exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
+				exams2.setExamStatus(9);
+				exams2.update();
 				examsd.add(record);
-//				WeixinService wService = ServiceFactory.getService(WeixinService.class);
-//				wService.requestWeixinQrcode(report.getId());
+				WeixinService wService = ServiceFactory.getService(WeixinService.class);
+				wService.requestWeixinQrcode(report.getId());
+				} catch (Exception e) {
+					// TODO: handle exception
+					continue;
+				}
 			}
 			this.renderJson(examsd);
 		} catch (Exception e) {