|
@@ -14,6 +14,7 @@ import com.zskk.model.Exams;
|
|
|
import com.zskk.model.PatientInfos;
|
|
|
import com.zskk.model.Report;
|
|
|
import com.zskk.model.Studies;
|
|
|
+import com.zskk.service.WeixinService;
|
|
|
|
|
|
public class ViewController extends Controller {
|
|
|
|
|
@@ -48,31 +49,38 @@ public class ViewController extends Controller {
|
|
|
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<>();
|
|
|
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());
|
|
|
+// Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
+ Record record = Db.use("connected").findFirst("select * from reportinfo where ACCESSIONNUMBER=?",exams2.getAccessionNum());
|
|
|
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(new String(record.getStr("DESCRIPTION").getBytes("windows-1252"),"GBK"));
|
|
|
+ report.setDescription(new String(record.getStr("IMPRESSION").getBytes("windows-1252"),"GBK"));
|
|
|
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(new String(record.getStr("REPORTDOCTOR").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.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(record.getStr("PATIENTNAME"));
|
|
|
-// patientInfos.update();
|
|
|
+ patientInfos.setName(new String(record.getStr("PATIENTNAME").getBytes("windows-1252"),"GBK"));
|
|
|
+// patientInfos.setPhone(record.getStr("PHONE"));
|
|
|
+// patientInfos.setCardNum(record.getStr("IDCARD"));
|
|
|
+ patientInfos.update();
|
|
|
+ exams2.setClinDoctors(new String(record.getStr("CLINICALDOCTOR").getBytes("windows-1252"),"GBK"));
|
|
|
+ exams2.setExamStatus(9);
|
|
|
+ exams2.update();
|
|
|
+ examds.add(record);
|
|
|
+// WeixinService wService = new WeixinService();
|
|
|
+// wService.requestWeixinQrcode(report.getId());
|
|
|
}
|
|
|
this.renderJson(examds);
|
|
|
} catch (Exception e) {
|
|
@@ -113,4 +121,19 @@ public class ViewController extends Controller {
|
|
|
return date;
|
|
|
}
|
|
|
|
|
|
+ private Date parseStringToDate(String dateStr) {
|
|
|
+ if (dateStr == null) {
|
|
|
+ return new Date();
|
|
|
+ }
|
|
|
+ SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date date = null;
|
|
|
+ try {
|
|
|
+ date = sdf.parse(dateStr);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return date;
|
|
|
+ }
|
|
|
+
|
|
|
}
|