diff --git a/src/main/java/BsK/client/ui/component/CheckUpPage/CheckUpPage.java b/src/main/java/BsK/client/ui/component/CheckUpPage/CheckUpPage.java index 221e277..8ffd7f3 100644 --- a/src/main/java/BsK/client/ui/component/CheckUpPage/CheckUpPage.java +++ b/src/main/java/BsK/client/ui/component/CheckUpPage/CheckUpPage.java @@ -147,7 +147,7 @@ public class CheckUpPage extends JPanel { private JTextPane notesField; private JComboBox doctorComboBox, statusComboBox, genderComboBox, provinceComboBox, districtComboBox, wardComboBox, checkupTypeComboBox, templateComboBox; private JSpinner customerWeightSpinner, customerHeightSpinner; - private JDatePickerImpl datePicker, dobPicker; + private JDatePickerImpl datePicker, dobPicker, recheckupDatePicker; private String[][] medicinePrescription = new String[0][0]; // Initialize to empty private String[][] servicePrescription = new String[0][0]; // Initialize to empty private String[] doctorOptions; @@ -1021,7 +1021,7 @@ public class CheckUpPage extends JPanel { new Font("Arial", Font.BOLD, 14), new Color(50, 50, 50) )); - suggestionField = new JTextArea(10, 20); // Increased rows from 4 to 10 + suggestionField = new JTextArea(5, 20); // Adjusted rows for better layout suggestionField.setFont(fieldFont); suggestionField.setLineWrap(true); suggestionField.setWrapStyleWord(true); @@ -1031,6 +1031,28 @@ public class CheckUpPage extends JPanel { suggestionPanel.setMinimumSize(new Dimension(200, 200)); suggestionPanel.setPreferredSize(new Dimension(250, 200)); + // Add Re-checkup date picker + JPanel recheckupPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 2)); + recheckupPanel.setBackground(Color.WHITE); + JLabel recheckupLabel = new JLabel("Tái khám:"); + recheckupLabel.setFont(labelFont); + recheckupPanel.add(recheckupLabel); + + UtilDateModel recheckupModel = new UtilDateModel(); + Properties recheckupProps = new Properties(); + recheckupProps.put("text.today", "Hôm nay"); + recheckupProps.put("text.month", "Tháng"); + recheckupProps.put("text.year", "Năm"); + JDatePanelImpl recheckupDatePanel = new JDatePanelImpl(recheckupModel, recheckupProps); + recheckupDatePicker = new JDatePickerImpl(recheckupDatePanel, new DateLabelFormatter()); + recheckupDatePicker.getJFormattedTextField().setFont(fieldFont); + recheckupDatePicker.setPreferredSize(new Dimension(140, 30)); // Make it a bit smaller + recheckupPanel.add(recheckupDatePicker); + suggestionPanel.add(recheckupPanel, BorderLayout.SOUTH); + + suggestionPanel.setMinimumSize(new Dimension(200, 200)); + suggestionPanel.setPreferredSize(new Dimension(250, 200)); + // Diagnosis Panel JPanel diagnosisPanel = new JPanel(new BorderLayout(5, 5)); diagnosisPanel.setBorder(BorderFactory.createTitledBorder( @@ -1134,7 +1156,7 @@ public class CheckUpPage extends JPanel { if (selectedRow >= 0 && history != null && selectedRow < history.length) { String[] selectedHistory = history[selectedRow]; // Ensure the selected record has enough data fields - if (selectedHistory != null && selectedHistory.length >= 8) { + if (selectedHistory != null && selectedHistory.length >= 11) { String checkupId = selectedHistory[1]; String patientName = customerFirstNameField.getText() + " " + customerLastNameField.getText(); String checkupDate = selectedHistory[0]; @@ -1142,8 +1164,10 @@ public class CheckUpPage extends JPanel { String diagnosis = selectedHistory[3]; String notes = selectedHistory[5]; String conclusion = selectedHistory[7]; - - openHistoryViewDialog(checkupId, patientName, checkupDate, suggestion, diagnosis, conclusion, notes); + String reCheckupDate = selectedHistory[8]; + String doctorName = selectedHistory[9] + " " + selectedHistory[10]; + + openHistoryViewDialog(checkupId, patientName, checkupDate, suggestion, diagnosis, conclusion, notes, reCheckupDate, doctorName); } else { log.warn("Selected history record has incomplete data. Length: {}", (selectedHistory != null ? selectedHistory.length : "null")); } @@ -1404,6 +1428,7 @@ public class CheckUpPage extends JPanel { TextUtils.scaleRtfFontSize(getRtfContentAsString()), conclusionField.getText(), suggestionField.getText(), + recheckupDatePicker.getJFormattedTextField().getText(), selectedImagesForPrint, printType, templateTitle @@ -1464,6 +1489,7 @@ public class CheckUpPage extends JPanel { TextUtils.scaleRtfFontSize(getRtfContentAsString()), conclusionField.getText(), suggestionField.getText(), + recheckupDatePicker.getJFormattedTextField().getText(), selectedImagesForPrint, printType, templateTitle @@ -1511,7 +1537,7 @@ public class CheckUpPage extends JPanel { queueManagementPage.updateQueueTable(); } } - + private void updatePrescriptionTree() { rootPrescriptionNode.removeAllChildren(); double totalMedicineCost = 0; @@ -1676,7 +1702,8 @@ public class CheckUpPage extends JPanel { suggestionField.setText(selectedPatient.getSuggestion()); // De nghi diagnosisField.setText(selectedPatient.getDiagnosis()); // Chuan doan conclusionField.setText(selectedPatient.getConclusion()); // Ket luan - + recheckupDatePicker.getJFormattedTextField().setText(selectedPatient.getReCheckupDate()); // Ngày khám lại + // Handle RTF notes content String notes = selectedPatient.getNotes(); if (notes != null && !notes.isEmpty()) { @@ -1793,35 +1820,35 @@ public class CheckUpPage extends JPanel { private void handleGetDistrictResponse(GetDistrictResponse response) { SwingUtilities.invokeLater(() -> { - log.info("Received district data"); - LocalStorage.districts = response.getDistricts(); - LocalStorage.districtToId = response.getDistrictToId(); - districtModel.removeAllElements(); - for (String district : LocalStorage.districts) { districtModel.addElement(district); } - districtComboBox.setEnabled(true); - if (LocalStorage.districts.length > 0 && !LocalStorage.districts[0].startsWith("Đang tải")) { - // No automatic selection, let user choose or handleRowSelection set it - } - wardModel.removeAllElements(); wardModel.addElement("Phường"); wardComboBox.setEnabled(false); + log.info("Received district data"); + LocalStorage.districts = response.getDistricts(); + LocalStorage.districtToId = response.getDistrictToId(); + districtModel.removeAllElements(); + for (String district : LocalStorage.districts) { districtModel.addElement(district); } + districtComboBox.setEnabled(true); + if (LocalStorage.districts.length > 0 && !LocalStorage.districts[0].startsWith("Đang tải")) { + // No automatic selection, let user choose or handleRowSelection set it + } + wardModel.removeAllElements(); wardModel.addElement("Phường"); wardComboBox.setEnabled(false); }); } private void handleGetWardResponse(GetWardResponse response) { SwingUtilities.invokeLater(() -> { - log.info("Received ward data"); - LocalStorage.wards = response.getWards(); - wardModel.removeAllElements(); - for (String ward : LocalStorage.wards) { wardModel.addElement(ward); } - wardComboBox.setEnabled(true); - if (LocalStorage.wards.length > 0 && !LocalStorage.wards[0].startsWith("Đang tải")) { - // No automatic selection - } + log.info("Received ward data"); + LocalStorage.wards = response.getWards(); + wardModel.removeAllElements(); + for (String ward : LocalStorage.wards) { wardModel.addElement(ward); } + wardComboBox.setEnabled(true); + if (LocalStorage.wards.length > 0 && !LocalStorage.wards[0].startsWith("Đang tải")) { + // No automatic selection + } }); } private void handleGetPatientHistoryResponse(GetPatientHistoryResponse response) { SwingUtilities.invokeLater(() -> { - log.info("Received patient history"); + log.info("Received patient history"); this.history = response.getHistory(); // Keep original 6-column data for the dialog // Prepare data specifically for the 5-column table view @@ -1847,76 +1874,76 @@ public class CheckUpPage extends JPanel { private void handleGetCheckUpQueueUpdateResponse(GetCheckUpQueueUpdateResponse response) { SwingUtilities.invokeLater(() -> { - log.info("Received checkup update queue"); - this.rawQueueForTv = response.getQueue(); - this.patientQueue.clear(); - if (this.rawQueueForTv != null) { - for (String[] patientData : this.rawQueueForTv) { - this.patientQueue.add(new Patient(patientData)); - } - } - if (queueManagementPage != null) { - queueManagementPage.updateQueueTable(); - } - if (tvQueueFrame != null && tvQueueFrame.isVisible()) { - tvQueueFrame.updateQueueData(this.rawQueueForTv); + log.info("Received checkup update queue"); + this.rawQueueForTv = response.getQueue(); + this.patientQueue.clear(); + if (this.rawQueueForTv != null) { + for (String[] patientData : this.rawQueueForTv) { + this.patientQueue.add(new Patient(patientData)); } + } + if (queueManagementPage != null) { + queueManagementPage.updateQueueTable(); + } + if (tvQueueFrame != null && tvQueueFrame.isVisible()) { + tvQueueFrame.updateQueueData(this.rawQueueForTv); + } }); } private void handleGetCheckUpQueueResponse(GetCheckUpQueueResponse response) { SwingUtilities.invokeLater(() -> { - log.info("Received checkup queue"); - this.rawQueueForTv = response.getQueue(); - this.patientQueue.clear(); - if (this.rawQueueForTv != null) { - for (String[] patientData : this.rawQueueForTv) { - this.patientQueue.add(new Patient(patientData)); - } - } - if (queueManagementPage != null) { - queueManagementPage.updateQueueTable(); - } - if (tvQueueFrame != null && tvQueueFrame.isVisible()) { - tvQueueFrame.updateQueueData(this.rawQueueForTv); + log.info("Received checkup queue"); + this.rawQueueForTv = response.getQueue(); + this.patientQueue.clear(); + if (this.rawQueueForTv != null) { + for (String[] patientData : this.rawQueueForTv) { + this.patientQueue.add(new Patient(patientData)); } + } + if (queueManagementPage != null) { + queueManagementPage.updateQueueTable(); + } + if (tvQueueFrame != null && tvQueueFrame.isVisible()) { + tvQueueFrame.updateQueueData(this.rawQueueForTv); + } }); } private void handleCallPatientResponse(CallPatientResponse response) { SwingUtilities.invokeLater(() -> { - log.info("Received call patient response: Room {}, Patient ID {}, Status {}", response.getRoomId(), response.getPatientId(), response.getStatus()); - if (tvQueueFrame != null && tvQueueFrame.isVisible()) { - if (response.getStatus() == Status.PROCESSING) { - String patientIdToFind = String.valueOf(response.getPatientId()); - String patientDisplayInfo = patientIdToFind; + log.info("Received call patient response: Room {}, Patient ID {}, Status {}", response.getRoomId(), response.getPatientId(), response.getStatus()); + if (tvQueueFrame != null && tvQueueFrame.isVisible()) { + if (response.getStatus() == Status.PROCESSING) { + String patientIdToFind = String.valueOf(response.getPatientId()); + String patientDisplayInfo = patientIdToFind; - if (this.patientQueue != null) { - for (Patient patient : this.patientQueue) { - if (patient != null && patientIdToFind.equals(patient.getCheckupId())) { - String ho = patient.getCustomerLastName(); String ten = patient.getCustomerFirstName(); - String customerDob = patient.getCustomerDob(); String namSinh = "N/A"; - if (customerDob != null && !customerDob.isEmpty()) { - try { - Date parsedDate; - if (customerDob.matches("\\d+")) parsedDate = new Date(Long.parseLong(customerDob)); // Timestamp - else parsedDate = new SimpleDateFormat("dd/MM/yyyy").parse(customerDob); // Date string - Calendar calendar = Calendar.getInstance(); calendar.setTime(parsedDate); - namSinh = String.valueOf(calendar.get(Calendar.YEAR)); - } catch (ParseException | NumberFormatException e) { - log.error("Error parsing DoB for TV display: {} for patient ID {}", customerDob, patientIdToFind, e); - } + if (this.patientQueue != null) { + for (Patient patient : this.patientQueue) { + if (patient != null && patientIdToFind.equals(patient.getCheckupId())) { + String ho = patient.getCustomerLastName(); String ten = patient.getCustomerFirstName(); + String customerDob = patient.getCustomerDob(); String namSinh = "N/A"; + if (customerDob != null && !customerDob.isEmpty()) { + try { + Date parsedDate; + if (customerDob.matches("\\d+")) parsedDate = new Date(Long.parseLong(customerDob)); // Timestamp + else parsedDate = new SimpleDateFormat("dd/MM/yyyy").parse(customerDob); // Date string + Calendar calendar = Calendar.getInstance(); calendar.setTime(parsedDate); + namSinh = String.valueOf(calendar.get(Calendar.YEAR)); + } catch (ParseException | NumberFormatException e) { + log.error("Error parsing DoB for TV display: {} for patient ID {}", customerDob, patientIdToFind, e); } - patientDisplayInfo = ho + " " + ten + " (" + namSinh + ")"; - break; } + patientDisplayInfo = ho + " " + ten + " (" + namSinh + ")"; + break; } } - tvQueueFrame.updateSpecificRoomStatus(response.getRoomId(), String.valueOf(response.getPatientId()), patientDisplayInfo, response.getStatus()); - } else if (response.getStatus() == Status.EMPTY) { - tvQueueFrame.markRoomAsFree(response.getRoomId()); } + tvQueueFrame.updateSpecificRoomStatus(response.getRoomId(), String.valueOf(response.getPatientId()), patientDisplayInfo, response.getStatus()); + } else if (response.getStatus() == Status.EMPTY) { + tvQueueFrame.markRoomAsFree(response.getRoomId()); } + } }); } @@ -3117,6 +3144,7 @@ public class CheckUpPage extends JPanel { String conclusion = conclusionField.getText(); String status = (String) statusComboBox.getSelectedItem(); String checkupType = (String) checkupTypeComboBox.getSelectedItem(); + String reCheckupDate = recheckupDatePicker.getJFormattedTextField().getText(); // Log all fields that will be sent to backend log.info("=== SaveCheckupRequest Data ==="); @@ -3140,6 +3168,7 @@ public class CheckUpPage extends JPanel { log.info("checkupType: {}", checkupType); log.info("medicinePrescription: {}", (Object) medicinePrescription); log.info("servicePrescription: {}", (Object) servicePrescription); + log.info("reCheckupDate: {}", reCheckupDate); log.info("=== End SaveCheckupRequest Data ==="); @@ -3162,6 +3191,7 @@ public class CheckUpPage extends JPanel { status, checkupType, conclusion, // Ket luan + reCheckupDate, medicinePrescription, servicePrescription ); @@ -3223,10 +3253,10 @@ public class CheckUpPage extends JPanel { /** * Opens the history view dialog for the selected checkup */ - private void openHistoryViewDialog(String checkupId, String patientName, String checkupDate, String suggestion, String diagnosis, String conclusion, String notes) { + private void openHistoryViewDialog(String checkupId, String patientName, String checkupDate, String suggestion, String diagnosis, String conclusion, String notes, String reCheckupDate, String doctorName) { try { // Pass all the necessary details to the dialog - HistoryViewDialog historyDialog = new HistoryViewDialog(mainFrame, checkupId, patientName, checkupDate, suggestion, diagnosis, conclusion, notes); + HistoryViewDialog historyDialog = new HistoryViewDialog(mainFrame, checkupId, patientName, checkupDate, suggestion, diagnosis, conclusion, notes, reCheckupDate, doctorName); historyDialog.setVisible(true); } catch (Exception e) { log.error("Error opening history view dialog", e); @@ -3264,6 +3294,7 @@ public class CheckUpPage extends JPanel { datePicker.getModel().setValue(null); dobPicker.getModel().setValue(null); + recheckupDatePicker.getModel().setValue(null); medicinePrescription = new String[0][0]; servicePrescription = new String[0][0]; diff --git a/src/main/java/BsK/client/ui/component/CheckUpPage/HistoryViewDialog/HistoryViewDialog.java b/src/main/java/BsK/client/ui/component/CheckUpPage/HistoryViewDialog/HistoryViewDialog.java index 7ffb60a..e77129b 100644 --- a/src/main/java/BsK/client/ui/component/CheckUpPage/HistoryViewDialog/HistoryViewDialog.java +++ b/src/main/java/BsK/client/ui/component/CheckUpPage/HistoryViewDialog/HistoryViewDialog.java @@ -44,6 +44,8 @@ public class HistoryViewDialog extends JDialog { private String suggestion; private String diagnosis; private String conclusion; + private String reCheckupDate; + private String doctorName; private String[][] medicinePrescription; private String[][] servicePrescription; @@ -74,7 +76,7 @@ public class HistoryViewDialog extends JDialog { private final ResponseListener orderInfoListener = this::handleGetOrderInfoResponse; private final ResponseListener imagesListener = this::handleGetImagesResponse; - public HistoryViewDialog(Frame parent, String checkupId, String patientName, String checkupDate, String suggestion, String diagnosis, String conclusion, String notes) { + public HistoryViewDialog(Frame parent, String checkupId, String patientName, String checkupDate, String suggestion, String diagnosis, String conclusion, String notes, String reCheckupDate, String doctorName) { super(parent, "Xem chi tiết lịch sử khám - " + patientName, true); this.checkupId = checkupId; this.patientName = patientName; @@ -86,7 +88,8 @@ public class HistoryViewDialog extends JDialog { this.suggestion = suggestion; this.diagnosis = diagnosis; this.conclusion = conclusion; - + this.reCheckupDate = reCheckupDate; + this.doctorName = doctorName; initializeDialog(parent); setupUI(); @@ -239,6 +242,28 @@ public class HistoryViewDialog extends JDialog { checkupIdLabel.setFont(new Font("Arial", Font.PLAIN, 12)); patientInfoPanel.add(checkupIdLabel, gbc); + gbc.gridy = 4; + gbc.gridx = 0; + JLabel doctorLabel = new JLabel("Bác sĩ khám:"); + doctorLabel.setFont(new Font("Arial", Font.BOLD, 12)); + patientInfoPanel.add(doctorLabel, gbc); + + gbc.gridx = 1; + JLabel doctorNameLabel = new JLabel(getDisplayableString(this.doctorName)); + doctorNameLabel.setFont(new Font("Arial", Font.PLAIN, 12)); + patientInfoPanel.add(doctorNameLabel, gbc); + + gbc.gridy = 5; + gbc.gridx = 0; + JLabel recheckupDateLabel = new JLabel("Ngày tái khám:"); + recheckupDateLabel.setFont(new Font("Arial", Font.BOLD, 12)); + patientInfoPanel.add(recheckupDateLabel, gbc); + + gbc.gridx = 1; + JLabel recheckupValueLabel = new JLabel(getDisplayableString(this.reCheckupDate)); + recheckupValueLabel.setFont(new Font("Arial", Font.PLAIN, 12)); + patientInfoPanel.add(recheckupValueLabel, gbc); + headerPanel.add(patientInfoPanel, BorderLayout.WEST); // Right side - Close button diff --git a/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/UltrasoundResult.java b/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/UltrasoundResult.java index 6281917..ea1de65 100644 --- a/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/UltrasoundResult.java +++ b/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/UltrasoundResult.java @@ -73,6 +73,7 @@ public class UltrasoundResult { private final String rtfContent; private final String conclusion; private final String suggestion; + private final String recheckupDate; private final List selectedImages; private final String printType; // "ngang" or "dọc" private final String templateTitle; @@ -82,7 +83,8 @@ public class UltrasoundResult { public UltrasoundResult(String checkupId, String patientName, String patientDOB, String patientGender, String patientAddress, String doctorName, String checkupDate, String rtfContent, String conclusion, String suggestion, - List selectedImages, String printType, String templateTitle) { + String recheckupDate, List selectedImages, + String printType, String templateTitle) { // Defensive null checks to prevent JasperReports from crashing on null parameters this.checkupId = checkupId != null ? checkupId : ""; @@ -95,6 +97,7 @@ public class UltrasoundResult { this.rtfContent = rtfContent != null ? rtfContent : ""; this.conclusion = conclusion != null ? conclusion : ""; this.suggestion = suggestion != null ? suggestion : ""; + this.recheckupDate = recheckupDate != null ? recheckupDate : ""; this.selectedImages = selectedImages != null ? selectedImages : new ArrayList<>(); this.printType = printType != null ? printType : ""; this.templateTitle = templateTitle != null ? templateTitle : ""; @@ -149,7 +152,7 @@ public class UltrasoundResult { parameters.put("checkupNote", this.rtfContent); parameters.put("checkupConclusion", this.conclusion); parameters.put("checkupSuggestion", this.suggestion); - parameters.put("reCheckupDate", "Tái khám theo lịch hẹn"); // Placeholder, adjust as needed + parameters.put("reCheckupDate", this.recheckupDate); // Handle images int numberOfImages = this.selectedImages.size(); diff --git a/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/print_forms/ultrasoundresult.jrxml b/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/print_forms/ultrasoundresult.jrxml index 2e6d1c7..9b391b7 100644 --- a/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/print_forms/ultrasoundresult.jrxml +++ b/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/print_forms/ultrasoundresult.jrxml @@ -141,13 +141,11 @@ - - @@ -236,7 +234,7 @@ - + diff --git a/src/main/java/BsK/common/entity/Patient.java b/src/main/java/BsK/common/entity/Patient.java index 16f4192..18a0413 100644 --- a/src/main/java/BsK/common/entity/Patient.java +++ b/src/main/java/BsK/common/entity/Patient.java @@ -25,6 +25,7 @@ public class Patient { private String customerDob; private String checkupType; private String conclusion; + private String reCheckupDate; public Patient(String[][] array) { this.checkupId = array[0][0]; @@ -45,12 +46,13 @@ public class Patient { this.customerDob = array[0][15]; this.checkupType = array[0][16]; this.conclusion = array[0][17]; + this.reCheckupDate = array[0][18]; } // New constructor for a single patient data row public Patient(String[] data) { - if (data.length < 18) { - throw new IllegalArgumentException("Patient data array must contain at least 18 elements to include a conclusion."); + if (data.length < 19) { + throw new IllegalArgumentException("Patient data array must contain at least 19 elements to include a conclusion."); } this.checkupId = data[0]; this.checkupDate = data[1]; @@ -70,5 +72,6 @@ public class Patient { this.customerDob = data[15]; this.checkupType = data[16]; this.conclusion = data[17]; + this.reCheckupDate = data[18]; } } diff --git a/src/main/java/BsK/common/entity/PatientHistory.java b/src/main/java/BsK/common/entity/PatientHistory.java index c5e5826..aa2e993 100644 --- a/src/main/java/BsK/common/entity/PatientHistory.java +++ b/src/main/java/BsK/common/entity/PatientHistory.java @@ -17,14 +17,17 @@ public class PatientHistory { private String diagnosis; private String prescriptionId; private String notes; + private String reCheckupDate; + private String doctorLastName; + private String doctorFirstName; /** * Constructor to create PatientHistory from array data * @param data Array of patient history data from backend */ public PatientHistory(String[] data) { - if (data.length < 6) { - throw new IllegalArgumentException("PatientHistory data array must contain at least 6 elements"); + if (data.length < 11) { + throw new IllegalArgumentException("PatientHistory data array must contain at least 11 elements"); } this.checkupDate = data[0]; this.checkupId = data[1]; @@ -32,6 +35,9 @@ public class PatientHistory { this.diagnosis = data[3]; this.prescriptionId = data[4]; this.notes = data[5]; + this.reCheckupDate = data[6]; + this.doctorLastName = data[7]; + this.doctorFirstName = data[8]; } /** @@ -39,6 +45,6 @@ public class PatientHistory { * @return String array representation of PatientHistory */ public String[] toStringArray() { - return new String[]{checkupDate, checkupId, suggestion, diagnosis, prescriptionId, notes}; + return new String[]{checkupDate, checkupId, suggestion, diagnosis, prescriptionId, notes, reCheckupDate, doctorLastName, doctorFirstName}; } } \ No newline at end of file diff --git a/src/main/java/BsK/common/packet/req/SaveCheckupRequest.java b/src/main/java/BsK/common/packet/req/SaveCheckupRequest.java index 69b1637..274711b 100644 --- a/src/main/java/BsK/common/packet/req/SaveCheckupRequest.java +++ b/src/main/java/BsK/common/packet/req/SaveCheckupRequest.java @@ -27,6 +27,7 @@ public class SaveCheckupRequest implements Packet { private String status; private String checkupType; private String conclusion; + private String reCheckupDate; private String[][] medicinePrescription; // Structure: [med_id, name, quantity, unit, dose_morning, dose_noon, dose_evening, unit_price, total_price, notes] private String[][] servicePrescription; // Structure: [ser_id, name, quantity, unit_price, total_price, notes] } \ No newline at end of file diff --git a/src/main/java/BsK/server/network/handler/ServerHandler.java b/src/main/java/BsK/server/network/handler/ServerHandler.java index e57f0ec..4978bcd 100644 --- a/src/main/java/BsK/server/network/handler/ServerHandler.java +++ b/src/main/java/BsK/server/network/handler/ServerHandler.java @@ -110,7 +110,7 @@ public class ServerHandler extends SimpleChannelInboundHandler resultList = new ArrayList<>(); while (rs.next()) { - String[] historyEntry = new String[8]; + String[] historyEntry = new String[11]; // Corrected size from 9 to 11 String checkupDateStr = rs.getString("checkup_date"); try { @@ -317,7 +326,9 @@ public class ServerHandler extends SimpleChannelInboundHandler