//int delay = ClientContext.getInt("chart.timerDelay"); // 200
String message = "カルテオープン";
String patientName = getPatientVisit().getPatient().getFullName() + sama;
String note = patientName + "を開いています...";
Task task = new Task<KarteBean>(null, message, note, maxEstimation) {
@Override
protected KarteBean doInBackground() throws Exception {
logger.debug("CahrtImpl start task doInBackground");
//
// Database から患者のカルテを取得する
//
int past = Project.getPreferences().getInt(Project.DOC_HISTORY_PERIOD, -12);
GregorianCalendar today = new GregorianCalendar();
today.add(GregorianCalendar.MONTH, past);
today.clear(Calendar.HOUR_OF_DAY);
today.clear(Calendar.MINUTE);
today.clear(Calendar.SECOND);
today.clear(Calendar.MILLISECOND);
DocumentDelegater ddl = new DocumentDelegater();
KarteBean karteBean = ddl.getKarte(getPatientVisit().getPatient().getId(), today.getTime());
return karteBean;
}
@Override
protected void succeeded(KarteBean karteBean) {
logger.debug("CahrtImpl start task succeeded");
karteBean.setPatient(null);
karteBean.setPatient(getPatientVisit().getPatient());
setKarte(karteBean);
initComponents();
logger.debug("initComponents end");
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
getDocumentHistory().showHistory();
}
});
}
};
//task.setMillisToPopup(delay);
task.execute();
}