return (PatientAdmissionSchedule) solutionBusiness.getSolution();
}
public void resetPanel() {
removeAll();
PatientAdmissionSchedule patientAdmissionSchedule = getPatientAdmissionSchedule();
gridLayout.setColumns(patientAdmissionSchedule.getNightList().size() + 1);
JLabel headerCornerLabel = new JLabel("Department_Room_Bed \\ Night");
headerCornerLabel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(Color.DARK_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
headerCornerLabel.setBackground(HEADER_COLOR);
headerCornerLabel.setOpaque(true);
add(headerCornerLabel);
for (Night night : patientAdmissionSchedule.getNightList()) {
JLabel nightLabel = new JLabel(night.toString());
nightLabel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(Color.DARK_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
nightLabel.setBackground(HEADER_COLOR);
nightLabel.setOpaque(true);
add(nightLabel);
}
Map<Bed, Map<Night, BedNightPanel>> bedNightPanelMap = new HashMap<Bed, Map<Night, BedNightPanel>>();
for (Bed bed : patientAdmissionSchedule.getBedList()) {
JLabel bedLabel = new JLabel(bed.toString());
bedLabel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(Color.DARK_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
bedLabel.setBackground(HEADER_COLOR);
bedLabel.setOpaque(true);
add(bedLabel);
Map<Night, BedNightPanel> nightPanelMap = new HashMap<Night, BedNightPanel>();
bedNightPanelMap.put(bed, nightPanelMap);
for (Night night : patientAdmissionSchedule.getNightList()) {
BedNightPanel bedNightPanel = new BedNightPanel();
add(bedNightPanel);
nightPanelMap.put(night, bedNightPanel);
}
}
if (patientAdmissionSchedule.isInitialized()) {
for (BedDesignation bedDesignation : patientAdmissionSchedule.getBedDesignationList()) {
for (Night night : patientAdmissionSchedule.getNightList()) {
if (bedDesignation.getAdmissionPart().getFirstNight().getIndex() <= night.getIndex()
&& night.getIndex() <= bedDesignation.getAdmissionPart().getLastNight().getIndex()) {
BedNightPanel bedNightPanel = bedNightPanelMap.get(bedDesignation.getBed()).get(night);
bedNightPanel.addBedDesignation(bedDesignation);
}