mirror of
https://github.com/tiennm99/BSK-All-in-One-Clinic-Management-System.git
synced 2026-10-17 22:14:01 +00:00
[update] Revise medical invoice format to enhance clarity and detail, including updated patient information and service costs. Integrate keyboard shortcuts for improved user interaction in CheckUpPage, and implement font family and size selection features in TemplateDialog for better customization options.
This commit is contained in:
1 parent
f68533455b
commit
77a6468a06
9 files changed
+498
-305
No files matched your search
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -104,6 +104,13 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
// --- JasperReports Imports ---
|
||||
import net.sf.jasperreports.engine.JasperPrint;
|
||||
import net.sf.jasperreports.engine.JasperPrintManager;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.view.JasperViewer;
|
||||
// --- End JasperReports Imports ---
|
||||
|
||||
// Add new imports
|
||||
import BsK.common.entity.PatientHistory;
|
||||
import BsK.common.packet.req.GetPatientHistoryRequest;
|
||||
@@ -155,6 +162,9 @@ public class CheckUpPage extends JPanel {
|
||||
private JLabel callingStatusLabel;
|
||||
private JPanel rightContainer; // Add this field
|
||||
private List<Template> allTemplates;
|
||||
private JButton openQueueButton;
|
||||
private JButton addPatientButton;
|
||||
private JButton[] actionButtons;
|
||||
|
||||
private QueueViewPage tvQueueFrame;
|
||||
private QueueManagementPage queueManagementPage; // The new queue window
|
||||
@@ -335,7 +345,7 @@ public class CheckUpPage extends JPanel {
|
||||
controlPanel.setBorder(BorderFactory.createEmptyBorder(3, 5, 3, 5)); // Reduced top/bottom from 5 to 3
|
||||
controlPanel.setBackground(Color.WHITE);
|
||||
|
||||
JButton openQueueButton = new JButton("Danh sách chờ");
|
||||
openQueueButton = new JButton("<html>Danh sách chờ <font color='red'><b>(F1)</b></font></html>");
|
||||
openQueueButton.setBackground(new Color(255, 152, 0)); // Amber
|
||||
openQueueButton.setForeground(Color.WHITE);
|
||||
openQueueButton.setFocusPainted(false);
|
||||
@@ -363,7 +373,7 @@ public class CheckUpPage extends JPanel {
|
||||
tvQueueFrame.setVisible(true);
|
||||
});
|
||||
|
||||
JButton addPatientButton = new JButton(" THÊM BN ");
|
||||
addPatientButton = new JButton("<html>THÊM BN <font color='red'><b>(F2)</b></font></html>");
|
||||
addPatientButton.setBackground(new Color(63, 81, 181));
|
||||
addPatientButton.setForeground(Color.WHITE);
|
||||
addPatientButton.setFocusPainted(false);
|
||||
@@ -914,17 +924,18 @@ public class CheckUpPage extends JPanel {
|
||||
underlineButton.setFocusPainted(false);
|
||||
underlineButton.setToolTipText("Gạch chân (Ctrl+U)");
|
||||
|
||||
// Font size buttons
|
||||
String[] sizes = {"12", "14", "16", "18", "20"};
|
||||
JComboBox<String> sizeComboBox = new JComboBox<>(sizes);
|
||||
sizeComboBox.setSelectedItem("16");
|
||||
sizeComboBox.setFont(new Font("Arial", Font.PLAIN, 14));
|
||||
sizeComboBox.setToolTipText("Cỡ chữ");
|
||||
sizeComboBox.addActionListener(e -> {
|
||||
String size = (String) sizeComboBox.getSelectedItem();
|
||||
if (size != null) {
|
||||
// Font family selector
|
||||
String[] fontFamilies = {"Arial", "Times New Roman", "Verdana", "Courier New", "Tahoma", "Calibri"};
|
||||
JComboBox<String> fontFamilyComboBox = new JComboBox<>(fontFamilies);
|
||||
fontFamilyComboBox.setSelectedItem("Times New Roman"); // Match default font of notesField
|
||||
fontFamilyComboBox.setFont(new Font("Arial", Font.PLAIN, 14));
|
||||
fontFamilyComboBox.setToolTipText("Phông chữ");
|
||||
fontFamilyComboBox.setPreferredSize(new Dimension(140, 25));
|
||||
fontFamilyComboBox.addActionListener(e -> {
|
||||
String fontFamily = (String) fontFamilyComboBox.getSelectedItem();
|
||||
if (fontFamily != null) {
|
||||
MutableAttributeSet attr = new SimpleAttributeSet();
|
||||
StyleConstants.setFontSize(attr, Integer.parseInt(size));
|
||||
StyleConstants.setFontFamily(attr, fontFamily);
|
||||
notesField.getStyledDocument().setCharacterAttributes(
|
||||
notesField.getSelectionStart(),
|
||||
notesField.getSelectionEnd() - notesField.getSelectionStart(),
|
||||
@@ -932,16 +943,21 @@ public class CheckUpPage extends JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
// Add buttons to toolbar with separators and styling
|
||||
notesToolbar.add(Box.createHorizontalStrut(5));
|
||||
notesToolbar.add(sizeComboBox);
|
||||
notesToolbar.addSeparator(new Dimension(10, 0));
|
||||
notesToolbar.add(boldButton);
|
||||
notesToolbar.addSeparator(new Dimension(5, 0));
|
||||
notesToolbar.add(italicButton);
|
||||
notesToolbar.addSeparator(new Dimension(5, 0));
|
||||
notesToolbar.add(underlineButton);
|
||||
notesToolbar.addSeparator(new Dimension(5, 0));
|
||||
// Font size spinner
|
||||
SpinnerModel sizeModel = new SpinnerNumberModel(20, 8, 72, 2); // Default 20, min 8, max 72, step 2
|
||||
JSpinner sizeSpinner = new JSpinner(sizeModel);
|
||||
sizeSpinner.setFont(new Font("Arial", Font.PLAIN, 14));
|
||||
sizeSpinner.setToolTipText("Cỡ chữ (Cỡ chữ JasperReport = giá trị / 2)");
|
||||
sizeSpinner.setPreferredSize(new Dimension(60, 25));
|
||||
sizeSpinner.addChangeListener(e -> {
|
||||
int size = (int) sizeSpinner.getValue();
|
||||
MutableAttributeSet attr = new SimpleAttributeSet();
|
||||
StyleConstants.setFontSize(attr, size);
|
||||
notesField.getStyledDocument().setCharacterAttributes(
|
||||
notesField.getSelectionStart(),
|
||||
notesField.getSelectionEnd() - notesField.getSelectionStart(),
|
||||
attr, false);
|
||||
});
|
||||
|
||||
// Color chooser button
|
||||
JButton colorButton = new JButton("Màu");
|
||||
@@ -956,8 +972,20 @@ public class CheckUpPage extends JPanel {
|
||||
notesField.setCharacterAttributes(attr, false);
|
||||
}
|
||||
});
|
||||
notesToolbar.add(colorButton);
|
||||
|
||||
// Add buttons to toolbar with separators and styling
|
||||
notesToolbar.add(Box.createHorizontalStrut(5));
|
||||
notesToolbar.add(fontFamilyComboBox);
|
||||
notesToolbar.addSeparator(new Dimension(5, 0));
|
||||
notesToolbar.add(sizeSpinner);
|
||||
notesToolbar.addSeparator(new Dimension(10, 0));
|
||||
notesToolbar.add(boldButton);
|
||||
notesToolbar.addSeparator(new Dimension(5, 0));
|
||||
notesToolbar.add(italicButton);
|
||||
notesToolbar.addSeparator(new Dimension(5, 0));
|
||||
notesToolbar.add(underlineButton);
|
||||
notesToolbar.addSeparator(new Dimension(10, 0));
|
||||
notesToolbar.add(colorButton);
|
||||
notesToolbar.add(Box.createHorizontalStrut(5));
|
||||
|
||||
// Style the toolbar buttons
|
||||
@@ -1196,21 +1224,22 @@ public class CheckUpPage extends JPanel {
|
||||
rightContainer.add(newRightSplitPane, BorderLayout.CENTER);
|
||||
|
||||
// Create a more modern action panel
|
||||
JPanel iconPanel = new JPanel(new GridLayout(1, 5, 10, 0)); // 5 buttons, 10px horizontal gap
|
||||
JPanel iconPanel = new JPanel(new GridLayout(2, 3, 10, 10)); // 2x3 grid with 10px gaps
|
||||
iconPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); // Reduced top/bottom from 10 to 5
|
||||
iconPanel.setBackground(Color.WHITE);
|
||||
|
||||
// Define button properties
|
||||
Object[][] buttonData = {
|
||||
{"save", "Lưu", new Color(63, 81, 181)},
|
||||
{"medicine", "Thêm thuốc", new Color(0, 150, 136)},
|
||||
{"service", "Thêm DV", new Color(255, 152, 0)},
|
||||
{"printer", "In toa", new Color(156, 39, 176)},
|
||||
{"ultrasound", "In kết quả", new Color(0, 172, 193)}
|
||||
{"printer", "<html><center>In toa thuốc<br><font color='red'>(F7)</font></center></html>", new Color(156, 39, 176)},
|
||||
{"save", "<html><center>Lưu<br><font color='red'>(F8)</font></center></html>", new Color(63, 81, 181)},
|
||||
{"loupe", "<html><center>Lưu & Xem KQ<br><font color='red'>(F9)</font></center></html>", new Color(0, 172, 193)},
|
||||
{"ultrasound", "<html><center>Lưu & In KQ<br><font color='red'>(F10)</font></center></html>", new Color(21, 101, 192)}
|
||||
};
|
||||
|
||||
// Create array to store action buttons for later access
|
||||
JButton[] actionButtons = new JButton[buttonData.length];
|
||||
actionButtons = new JButton[buttonData.length];
|
||||
|
||||
for (int i = 0; i < buttonData.length; i++) {
|
||||
String name = (String) buttonData[i][0];
|
||||
@@ -1243,6 +1272,7 @@ public class CheckUpPage extends JPanel {
|
||||
|
||||
// In the constructor, after creating notesField:
|
||||
setupNotesPasteHandler();
|
||||
setupShortcuts();
|
||||
}
|
||||
|
||||
private JButton createActionButton(String iconName, String text, Color bgColor) {
|
||||
@@ -1315,20 +1345,8 @@ public class CheckUpPage extends JPanel {
|
||||
}
|
||||
|
||||
String statusToSave = (String) statusComboBox.getSelectedItem();
|
||||
|
||||
handleSave();
|
||||
|
||||
callingStatusLabel.setText("Đã lưu thành công!");
|
||||
callingStatusLabel.setBackground(new Color(230, 255, 230));
|
||||
callingStatusLabel.setForeground(new Color(0, 100, 0));
|
||||
updateUpdateQueue();
|
||||
|
||||
// If patient is marked as "ĐÃ KHÁM", clear the selection and details immediately.
|
||||
if ("ĐÃ KHÁM".equals(statusToSave)) {
|
||||
clearPatientDetails();
|
||||
// Visually update the queue table to remove the selection highlight.
|
||||
queueManagementPage.updateQueueTable();
|
||||
}
|
||||
afterSaveActions(statusToSave, "Đã lưu thành công!");
|
||||
break;
|
||||
case "medicine":
|
||||
medDialog = new MedicineDialog(mainFrame, this.medicinePrescription);
|
||||
@@ -1359,7 +1377,8 @@ public class CheckUpPage extends JPanel {
|
||||
);
|
||||
medicineInvoice.showDirectJasperViewer(); // Use the direct JasperViewer method
|
||||
break;
|
||||
case "ultrasound":
|
||||
case "ultrasound": // This case now handles "Lưu & In"
|
||||
// Step 1: Validate conditions first.
|
||||
if (selectedImagesForPrint.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(this,
|
||||
"Vui lòng chọn ít nhất một hình ảnh để in kết quả.",
|
||||
@@ -1373,7 +1392,8 @@ public class CheckUpPage extends JPanel {
|
||||
return;
|
||||
}
|
||||
|
||||
UltrasoundResult ultrasoundResult = new UltrasoundResult(
|
||||
// Step 2: Attempt to create the report object BEFORE saving anything.
|
||||
UltrasoundResult ultrasoundResultPrint = new UltrasoundResult(
|
||||
checkupIdField.getText(),
|
||||
customerLastNameField.getText() + " " + customerFirstNameField.getText(),
|
||||
dobPicker.getJFormattedTextField().getText(),
|
||||
@@ -1388,11 +1408,110 @@ public class CheckUpPage extends JPanel {
|
||||
printType,
|
||||
templateTitle
|
||||
);
|
||||
ultrasoundResult.showDirectJasperViewer();
|
||||
|
||||
JasperPrint jasperPrintToPrint;
|
||||
try {
|
||||
jasperPrintToPrint = ultrasoundResultPrint.createJasperPrint();
|
||||
if (jasperPrintToPrint == null) {
|
||||
throw new Exception("Báo cáo được tạo là null.");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("Failed to create JasperPrint for printing", ex);
|
||||
JOptionPane.showMessageDialog(this, "Không thể tạo báo cáo để in: " + ex.getMessage(), "Lỗi Báo Cáo", JOptionPane.ERROR_MESSAGE);
|
||||
return; // HALT if report creation fails.
|
||||
}
|
||||
|
||||
// Step 3: If report creation is successful, commit by saving and printing.
|
||||
if ("ĐANG KHÁM".equals(statusComboBox.getSelectedItem())) {
|
||||
statusComboBox.setSelectedItem("ĐÃ KHÁM");
|
||||
}
|
||||
String statusToSavePrint = (String) statusComboBox.getSelectedItem();
|
||||
handleSave();
|
||||
afterSaveActions(statusToSavePrint, "Đã lưu. Đang gửi lệnh in...");
|
||||
|
||||
// Step 4: Finally, print using the pre-made object.
|
||||
try {
|
||||
JasperPrintManager.printReport(jasperPrintToPrint, false);
|
||||
} catch (JRException e) {
|
||||
log.error("Error printing report directly", e);
|
||||
JOptionPane.showMessageDialog(this, "Không thể in trực tiếp: " + e.getMessage(), "Lỗi In", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
break;
|
||||
case "loupe": // This case now handles "Lưu & Xem"
|
||||
// Step 1: Validate conditions first.
|
||||
if (selectedImagesForPrint.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(this,
|
||||
"Vui lòng chọn ít nhất một hình ảnh để xem kết quả.",
|
||||
"Chưa chọn ảnh", JOptionPane.WARNING_MESSAGE);
|
||||
return;
|
||||
}
|
||||
if (photoNum != 0 && selectedImagesForPrint.size() > photoNum) {
|
||||
JOptionPane.showMessageDialog(this,
|
||||
"Số lượng ảnh đã chọn (" + selectedImagesForPrint.size() + ") nhiều hơn số lượng cho phép trong mẫu (" + photoNum + ").",
|
||||
"Quá nhiều ảnh", JOptionPane.WARNING_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 2: Attempt to create the report object BEFORE saving anything.
|
||||
UltrasoundResult ultrasoundResultView = new UltrasoundResult(
|
||||
checkupIdField.getText(),
|
||||
customerLastNameField.getText() + " " + customerFirstNameField.getText(),
|
||||
dobPicker.getJFormattedTextField().getText(),
|
||||
(String) genderComboBox.getSelectedItem(),
|
||||
customerAddressField.getText() + ", " + (wardComboBox.getSelectedItem() != null ? wardComboBox.getSelectedItem().toString() : "") + ", " + (districtComboBox.getSelectedItem() != null ? districtComboBox.getSelectedItem().toString() : "") + ", " + (provinceComboBox.getSelectedItem() != null ? provinceComboBox.getSelectedItem().toString() : ""),
|
||||
(String) doctorComboBox.getSelectedItem(),
|
||||
datePicker.getJFormattedTextField().getText(),
|
||||
TextUtils.scaleRtfFontSize(getRtfContentAsString()),
|
||||
conclusionField.getText(),
|
||||
suggestionField.getText(),
|
||||
selectedImagesForPrint,
|
||||
printType,
|
||||
templateTitle
|
||||
);
|
||||
|
||||
JasperPrint jasperPrintToView;
|
||||
try {
|
||||
jasperPrintToView = ultrasoundResultView.createJasperPrint();
|
||||
if (jasperPrintToView == null) {
|
||||
throw new Exception("Báo cáo được tạo là null.");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("Failed to create JasperPrint for viewing", ex);
|
||||
JOptionPane.showMessageDialog(this, "Không thể tạo báo cáo xem trước: " + ex.getMessage(), "Lỗi Báo Cáo", JOptionPane.ERROR_MESSAGE);
|
||||
return; // HALT if report creation fails.
|
||||
}
|
||||
|
||||
// Step 3: If report creation is successful, commit by saving and showing the view.
|
||||
// NO automatic status change for "Lưu & Xem"
|
||||
String statusToSaveView = (String) statusComboBox.getSelectedItem();
|
||||
handleSave();
|
||||
afterSaveActions(statusToSaveView, "Đã lưu. Đang tạo bản xem trước...");
|
||||
|
||||
// Step 4: Finally, show the viewer with the pre-made object.
|
||||
JasperViewer.viewReport(jasperPrintToView, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to perform common actions after any save operation.
|
||||
* @param statusToSave The patient status that was saved.
|
||||
* @param message The message to display in the status label.
|
||||
*/
|
||||
private void afterSaveActions(String statusToSave, String message) {
|
||||
callingStatusLabel.setText(message);
|
||||
callingStatusLabel.setBackground(new Color(230, 255, 230));
|
||||
callingStatusLabel.setForeground(new Color(0, 100, 0));
|
||||
updateUpdateQueue();
|
||||
|
||||
// If patient is marked as "ĐÃ KHÁM", clear the selection and details immediately.
|
||||
if ("ĐÃ KHÁM".equals(statusToSave)) {
|
||||
clearPatientDetails();
|
||||
// Visually update the queue table to remove the selection highlight.
|
||||
queueManagementPage.updateQueueTable();
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePrescriptionTree() {
|
||||
rootPrescriptionNode.removeAllChildren();
|
||||
double totalMedicineCost = 0;
|
||||
@@ -1978,12 +2097,12 @@ public class CheckUpPage extends JPanel {
|
||||
JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 5, 5));
|
||||
buttonPanel.setOpaque(false);
|
||||
|
||||
takePictureButton = new JButton("Chụp ảnh");
|
||||
takePictureButton = new JButton("<html>Chụp ảnh <font color='red'><b>(F5)</b></font></html>");
|
||||
takePictureButton.setIcon(new ImageIcon("src/main/java/BsK/client/ui/assets/icon/camera.png"));
|
||||
takePictureButton.addActionListener(e -> handleTakePicture());
|
||||
takePictureButton.setEnabled(false);
|
||||
|
||||
recordVideoButton = new JButton("Quay video");
|
||||
recordVideoButton = new JButton("<html>Quay video <font color='red'><b>(F6)</b></font></html>");
|
||||
recordVideoButton.setIcon(new ImageIcon("src/main/java/BsK/client/ui/assets/icon/video-camera.png"));
|
||||
recordVideoButton.addActionListener(e -> handleRecordVideo());
|
||||
recordVideoButton.setEnabled(false);
|
||||
@@ -2441,7 +2560,7 @@ public class CheckUpPage extends JPanel {
|
||||
recordingThread.setPriority(Thread.MAX_PRIORITY);
|
||||
|
||||
isRecording = true;
|
||||
recordVideoButton.setText("Dừng");
|
||||
recordVideoButton.setText("<html>Dừng <font color='red'><b>(F6)</b></font></html>");
|
||||
recordVideoButton.setBackground(Color.RED);
|
||||
recordingTimeLabel.setVisible(true);
|
||||
recordingTimeLabel.setForeground(Color.RED);
|
||||
@@ -2493,7 +2612,7 @@ public class CheckUpPage extends JPanel {
|
||||
frameConverter = null;
|
||||
}
|
||||
|
||||
recordVideoButton.setText("Quay video");
|
||||
recordVideoButton.setText("<html>Quay video <font color='red'><b>(F6)</b></font></html>");
|
||||
recordVideoButton.setBackground(null);
|
||||
recordingTimeLabel.setVisible(false);
|
||||
recordingTimer.stop();
|
||||
@@ -3171,6 +3290,105 @@ public class CheckUpPage extends JPanel {
|
||||
saved = true; // No patient loaded, so it's in a "saved" state.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up keyboard shortcuts for the entire page.
|
||||
*/
|
||||
private void setupShortcuts() {
|
||||
InputMap inputMap = this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
|
||||
ActionMap actionMap = this.getActionMap();
|
||||
|
||||
// F1: Open Queue
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), "openQueue");
|
||||
actionMap.put("openQueue", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (openQueueButton != null && openQueueButton.isEnabled()) {
|
||||
openQueueButton.doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F2: Add New Patient
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), "addPatient");
|
||||
actionMap.put("addPatient", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (addPatientButton != null && addPatientButton.isEnabled()) {
|
||||
addPatientButton.doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F5: Take Picture
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), "takePicture");
|
||||
actionMap.put("takePicture", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (takePictureButton != null && takePictureButton.isEnabled()) {
|
||||
takePictureButton.doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F6: Record Video
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), "recordVideo");
|
||||
actionMap.put("recordVideo", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (recordVideoButton != null && recordVideoButton.isEnabled()) {
|
||||
recordVideoButton.doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F7: Print Invoice
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0), "printInvoice");
|
||||
actionMap.put("printInvoice", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (actionButtons[2] != null && actionButtons[2].isEnabled()) {
|
||||
handleActionPanelClick("printer");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F8: Save
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F8, 0), "saveAction");
|
||||
actionMap.put("saveAction", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (actionButtons[3] != null && actionButtons[3].isEnabled()) {
|
||||
// Bypass confirmation dialog for shortcut
|
||||
String statusToSave = (String) statusComboBox.getSelectedItem();
|
||||
handleSave();
|
||||
afterSaveActions(statusToSave, "Đã lưu thành công (F8)");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F9: Save and View
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0), "saveAndView");
|
||||
actionMap.put("saveAndView", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (actionButtons[4] != null && actionButtons[4].isEnabled()) {
|
||||
handleActionPanelClick("loupe");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// F10: Save and Print
|
||||
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0), "saveAndPrint");
|
||||
actionMap.put("saveAndPrint", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (actionButtons[5] != null && actionButtons[5].isEnabled()) {
|
||||
handleActionPanelClick("ultrasound");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+46
-24
@@ -35,6 +35,7 @@ import net.sf.jasperreports.engine.JasperReport;
|
||||
import net.sf.jasperreports.engine.design.JasperDesign;
|
||||
import net.sf.jasperreports.engine.xml.JRXmlLoader;
|
||||
import net.sf.jasperreports.view.JasperViewer;
|
||||
import net.sf.jasperreports.engine.JasperPrintManager;
|
||||
// --- End JasperReports Imports ---
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@@ -54,6 +55,9 @@ import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import net.sf.jasperreports.engine.JRParameter;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import java.util.ArrayList;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Slf4j
|
||||
public class UltrasoundResult {
|
||||
@@ -79,23 +83,51 @@ public class UltrasoundResult {
|
||||
String patientAddress, String doctorName, String checkupDate,
|
||||
String rtfContent, String conclusion, String suggestion,
|
||||
List<File> selectedImages, String printType, String templateTitle) {
|
||||
this.checkupId = checkupId;
|
||||
this.patientName = patientName;
|
||||
this.patientDOB = patientDOB;
|
||||
this.patientGender = patientGender;
|
||||
this.patientAddress = patientAddress;
|
||||
this.doctorName = doctorName;
|
||||
this.checkupDate = checkupDate;
|
||||
this.rtfContent = rtfContent;
|
||||
this.conclusion = conclusion;
|
||||
this.suggestion = suggestion;
|
||||
this.selectedImages = selectedImages;
|
||||
this.printType = printType;
|
||||
this.templateTitle = templateTitle;
|
||||
|
||||
// Defensive null checks to prevent JasperReports from crashing on null parameters
|
||||
this.checkupId = checkupId != null ? checkupId : "";
|
||||
this.patientName = patientName != null ? patientName : "";
|
||||
this.patientDOB = patientDOB != null ? patientDOB : "";
|
||||
this.patientGender = patientGender != null ? patientGender : "";
|
||||
this.patientAddress = patientAddress != null ? patientAddress : "";
|
||||
this.doctorName = doctorName != null ? doctorName : "";
|
||||
this.checkupDate = checkupDate != null ? checkupDate : "";
|
||||
this.rtfContent = rtfContent != null ? rtfContent : "";
|
||||
this.conclusion = conclusion != null ? conclusion : "";
|
||||
this.suggestion = suggestion != null ? suggestion : "";
|
||||
this.selectedImages = selectedImages != null ? selectedImages : new ArrayList<>();
|
||||
this.printType = printType != null ? printType : "";
|
||||
this.templateTitle = templateTitle != null ? templateTitle : "";
|
||||
}
|
||||
|
||||
public void showDirectJasperViewer() {
|
||||
try {
|
||||
JasperPrint jasperPrint = createJasperPrint();
|
||||
if (jasperPrint != null) {
|
||||
JasperViewer.viewReport(jasperPrint, false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Error displaying JasperViewer for Ultrasound Result", e);
|
||||
JOptionPane.showMessageDialog(null, "Không thể hiển thị bản xem trước: " + e.getMessage(), "Lỗi Jasper", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
public void printDirectly() {
|
||||
try {
|
||||
JasperPrint jasperPrint = createJasperPrint();
|
||||
if (jasperPrint != null) {
|
||||
// The 'false' argument means no print dialog will be shown.
|
||||
JasperPrintManager.printReport(jasperPrint, false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Error printing report directly for Ultrasound Result", e);
|
||||
JOptionPane.showMessageDialog(null, "Không thể in trực tiếp: " + e.getMessage(), "Lỗi In", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
public JasperPrint createJasperPrint() throws JRException, IOException {
|
||||
String jrxmlPath = System.getProperty("user.dir") + "/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/print_forms/ultrasoundresult.jrxml";
|
||||
try (InputStream inputStream = new FileInputStream(new File(jrxmlPath))) {
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
|
||||
// Set locale for date/number formatting
|
||||
@@ -135,21 +167,13 @@ public class UltrasoundResult {
|
||||
}
|
||||
|
||||
// Load and compile the report
|
||||
String jrxmlPath = projectDir + "/src/main/java/BsK/client/ui/component/CheckUpPage/PrintDialog/print_forms/ultrasoundresult.jrxml";
|
||||
InputStream inputStream = new FileInputStream(new File(jrxmlPath));
|
||||
|
||||
JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
|
||||
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
|
||||
|
||||
// Fill the report
|
||||
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());
|
||||
|
||||
// View the report
|
||||
JasperViewer.viewReport(jasperPrint, false);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Error generating or showing JasperReport for Ultrasound", e);
|
||||
JOptionPane.showMessageDialog(null, "Lỗi khi tạo báo cáo siêu âm: " + e.getMessage(), "Lỗi JasperReport", JOptionPane.ERROR_MESSAGE);
|
||||
return jasperPrint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,6 +661,4 @@ public class UltrasoundResult {
|
||||
signatureTable.addCell(new Cell().add(signParagraph).setBorder(Border.NO_BORDER));
|
||||
return signatureTable;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+115
-190
@@ -79,7 +79,7 @@
|
||||
</variable>
|
||||
<group name="group_thuoc">
|
||||
<groupHeader>
|
||||
<band height="85">
|
||||
<band height="83">
|
||||
<printWhenExpression><![CDATA[$P{hasMedicines}]]></printWhenExpression>
|
||||
<element kind="component" uuid="c0ec0570-9841-4438-a387-2e29436a01e7" x="8" y="18" width="539" height="65">
|
||||
<printWhenExpression><![CDATA[$P{hasMedicines}]]></printWhenExpression>
|
||||
@@ -88,9 +88,9 @@
|
||||
<dataSourceExpression><![CDATA[$P{medicineDS}]]></dataSourceExpression>
|
||||
<returnValue toVariable="MedicineGrandTotal" fromVariable="medTotal"/>
|
||||
</datasetRun>
|
||||
<column kind="single" uuid="249a6076-168a-4d8c-ba6c-92ca1d870834" width="160">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="9b6682e0-0e7a-48be-baa3-932a54d0c959" x="0" y="0" width="160" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="249a6076-168a-4d8c-ba6c-92ca1d870834" width="300">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="9b6682e0-0e7a-48be-baa3-932a54d0c959" x="0" y="0" width="300" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Tên thuốc]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -99,6 +99,7 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
|
||||
@@ -109,8 +110,8 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="bc690d0f-bc31-4bcc-a134-ff5deb5be586" x="0" y="0" width="160" height="15" fontName="Arial" fontSize="8.0" hTextAlign="Left" vTextAlign="Top">
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="bc690d0f-bc31-4bcc-a134-ff5deb5be586" x="0" y="0" width="300" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left" vTextAlign="Top">
|
||||
<expression><![CDATA[$F{medName}]]></expression>
|
||||
<box topPadding="3" leftPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -119,8 +120,8 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<element kind="textField" uuid="9b848a7f-a2e8-4360-9e6c-b5fde8d00361" x="0" y="15" width="160" height="15" fontName="Arial" fontSize="8.0" italic="true">
|
||||
<expression><![CDATA["Ghi chú: " + $F{medNote}]]></expression>
|
||||
<element kind="textField" uuid="9b848a7f-a2e8-4360-9e6c-b5fde8d00361" x="0" y="15" width="300" height="14" fontName="Arial" fontSize="8.0" italic="true">
|
||||
<expression><![CDATA["Ghi chú: " + $F{medNote} +", " + $F{dosage}]]></expression>
|
||||
<box leftPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -128,6 +129,7 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<property name="com.jaspersoft.studio.unit.height" value="px"/>
|
||||
<box style="Table_TD">
|
||||
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -137,49 +139,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
|
||||
</column>
|
||||
<column kind="single" uuid="f60271bc-52a8-4c6d-b0c7-6f8f4992eb76" width="90">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="0e5182ab-966b-4402-a5c3-a3b2eb23259e" x="0" y="0" width="90" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Liều dùng]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="797d2d36-5447-4ad1-be15-79b697389206" x="0" y="0" width="90" height="30" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{dosage}]]></expression>
|
||||
<box topPadding="3" leftPadding="3">
|
||||
<pen lineWidth="1.0"/>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<box style="Table_TD">
|
||||
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
|
||||
</column>
|
||||
<column kind="single" uuid="dd7c9141-b6c3-4471-916b-43e980f65a47" width="80">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="ae479f63-bbbf-4271-85e3-59bf587e90b6" x="0" y="0" width="80" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="dd7c9141-b6c3-4471-916b-43e980f65a47" width="50">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="ae479f63-bbbf-4271-85e3-59bf587e90b6" x="0" y="0" width="50" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[SL]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -197,8 +159,8 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="f200da37-dcd6-40f6-aa63-558a6f9ace69" x="0" y="0" width="80" height="30" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="f200da37-dcd6-40f6-aa63-558a6f9ace69" x="0" y="0" width="50" height="29" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{amount}]]></expression>
|
||||
<box topPadding="3" leftPadding="3" bottomPadding="0" rightPadding="0">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -216,9 +178,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
|
||||
</column>
|
||||
<column kind="single" uuid="d0909427-1340-4ba9-950e-ba0fdedd2638" width="99">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="72a37327-ff08-4bf2-98d7-224713fb08e1" x="0" y="0" width="99" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="d0909427-1340-4ba9-950e-ba0fdedd2638" width="100">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="72a37327-ff08-4bf2-98d7-224713fb08e1" x="0" y="0" width="100" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Đơn giá (VND)]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -229,9 +191,10 @@
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<element kind="staticText" uuid="c9e64949-22e1-4894-b6c2-4547444cea01" x="0" y="0" width="99" height="30" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left" vTextAlign="Top">
|
||||
<element kind="staticText" uuid="705eed6a-2cbd-4649-8f7c-e44b3d21e331" x="0" y="0" width="100" height="30" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<text><![CDATA[Tổng tiền thuốc:]]></text>
|
||||
<box topPadding="3" leftPadding="3"/>
|
||||
<property name="com.jaspersoft.studio.unit.height" value="px"/>
|
||||
<box topPadding="3" leftPadding="0"/>
|
||||
</element>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -240,8 +203,8 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="3b16ef7d-483a-4149-88d3-c0b8b0e35dde" x="0" y="0" width="99" height="30" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="3b16ef7d-483a-4149-88d3-c0b8b0e35dde" x="0" y="0" width="100" height="29" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{unitPrice}]]></expression>
|
||||
<box topPadding="3" leftPadding="3" rightPadding="3">
|
||||
<pen lineWidth="1.0"/>
|
||||
@@ -260,9 +223,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
|
||||
</column>
|
||||
<column kind="single" uuid="aeb60052-ca3b-42d2-937e-3a40af79b35c" width="110">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="ec36d49b-ab0f-4e85-a43f-ad8b5715edb7" x="0" y="0" width="110" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="aeb60052-ca3b-42d2-937e-3a40af79b35c" width="89">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="ec36d49b-ab0f-4e85-a43f-ad8b5715edb7" x="0" y="0" width="89" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Thành tiền (VND)]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -273,9 +236,9 @@
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<element kind="textField" uuid="c4a50fa9-96a2-498f-8df1-211aa2ad308b" x="0" y="0" width="110" height="30" pattern="#,##0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<element kind="textField" uuid="c4a50fa9-96a2-498f-8df1-211aa2ad308b" x="0" y="0" width="89" height="30" pattern="#,##0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<expression><![CDATA[$V{medTotal}]]></expression>
|
||||
<box topPadding="3" rightPadding="3">
|
||||
<box topPadding="2" rightPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -289,8 +252,8 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="02937f0a-f5d4-4549-a3ac-75615083057e" x="0" y="0" width="110" height="30" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="02937f0a-f5d4-4549-a3ac-75615083057e" x="0" y="0" width="89" height="29" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<expression><![CDATA[$V{medRowTotal}]]></expression>
|
||||
<box topPadding="3" leftPadding="0" rightPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -314,7 +277,7 @@
|
||||
<property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
|
||||
<property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
|
||||
</element>
|
||||
<element kind="staticText" uuid="9117208f-15de-4a22-8c8a-a994a0c99777" x="232" y="0" width="100" height="18" fontSize="14.0" bold="true" hTextAlign="Center">
|
||||
<element kind="staticText" uuid="9117208f-15de-4a22-8c8a-a994a0c99777" x="232" y="0" width="100" height="18" fontName="Times New Roman" fontSize="14.0" bold="true" hTextAlign="Center">
|
||||
<printWhenExpression><![CDATA[$P{hasMedicines}]]></printWhenExpression>
|
||||
<text><![CDATA[THUỐC]]></text>
|
||||
</element>
|
||||
@@ -323,22 +286,22 @@
|
||||
</group>
|
||||
<group name="group_dichvu">
|
||||
<groupHeader>
|
||||
<band height="95">
|
||||
<band height="83">
|
||||
<printWhenExpression><![CDATA[$P{hasServices}]]></printWhenExpression>
|
||||
<element kind="staticText" uuid="5a4c9016-75d9-4a19-aa4d-7af0a0d88dbc" positionType="Float" x="235" y="4" width="100" height="18" fontSize="14.0" bold="true" hTextAlign="Center">
|
||||
<element kind="staticText" uuid="5a4c9016-75d9-4a19-aa4d-7af0a0d88dbc" positionType="Float" x="235" y="-2" width="100" height="18" fontName="Times New Roman" fontSize="14.0" bold="true" hTextAlign="Center">
|
||||
<printWhenExpression><![CDATA[$P{hasServices}]]></printWhenExpression>
|
||||
<text><![CDATA[DỊCH VỤ]]></text>
|
||||
</element>
|
||||
<element kind="component" uuid="68c80e54-2998-4cf3-91c0-42fde9130772" positionType="Float" x="10" y="24" width="539" height="69">
|
||||
<element kind="component" uuid="68c80e54-2998-4cf3-91c0-42fde9130772" positionType="Float" x="10" y="18" width="539" height="65">
|
||||
<printWhenExpression><![CDATA[$P{hasServices}]]></printWhenExpression>
|
||||
<component kind="table">
|
||||
<datasetRun uuid="24cf5328-ecae-4c68-8955-73475b8823b4" subDataset="med_pre">
|
||||
<dataSourceExpression><![CDATA[$P{serviceDS}]]></dataSourceExpression>
|
||||
<returnValue toVariable="ServiceGrandTotal" fromVariable="serTotal"/>
|
||||
</datasetRun>
|
||||
<column kind="single" uuid="9be00b0a-9844-4037-a53e-be1970a83d48" width="240">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="f3bfa0e9-452f-417c-a96b-a36de1d89c60" x="0" y="0" width="240" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="9be00b0a-9844-4037-a53e-be1970a83d48" width="290">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="f3bfa0e9-452f-417c-a96b-a36de1d89c60" x="0" y="0" width="290" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Tên dịch vụ]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -347,6 +310,7 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<property name="com.jaspersoft.studio.unit.height" value="px"/>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
|
||||
@@ -358,7 +322,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="a16334e1-e3e0-4c20-a22d-7ce6a546edc8" x="0" y="0" width="240" height="15" fontName="Arial" fontSize="8.0" hTextAlign="Left" vTextAlign="Top">
|
||||
<element kind="textField" uuid="a16334e1-e3e0-4c20-a22d-7ce6a546edc8" x="0" y="0" width="290" height="15" fontName="Arial" fontSize="8.0" hTextAlign="Left" vTextAlign="Top">
|
||||
<expression><![CDATA[$F{serName}]]></expression>
|
||||
<box topPadding="3" leftPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -367,7 +331,7 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<element kind="textField" uuid="48a3aa97-2f44-433e-a5b3-28fbcc0b0877" x="0" y="15" width="240" height="14" fontName="Arial" fontSize="8.0" italic="true">
|
||||
<element kind="textField" uuid="48a3aa97-2f44-433e-a5b3-28fbcc0b0877" x="0" y="15" width="290" height="14" fontName="Arial" fontSize="8.0" italic="true">
|
||||
<expression><![CDATA["Ghi chú: " + $F{serNote}]]></expression>
|
||||
<box leftPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -385,9 +349,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
|
||||
</column>
|
||||
<column kind="single" uuid="5d4cb5ab-0637-4bc5-9aa4-51d8748d93a3" width="90">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="7d80482e-8a8d-4afe-9024-2ebddcd229ba" x="0" y="0" width="90" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="5d4cb5ab-0637-4bc5-9aa4-51d8748d93a3" width="59">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="7d80482e-8a8d-4afe-9024-2ebddcd229ba" x="0" y="0" width="59" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[SL]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -406,7 +370,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="48ad7d8f-6a79-4804-9f36-9f5c8b6ce888" x="0" y="0" width="90" height="29" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<element kind="textField" uuid="48ad7d8f-6a79-4804-9f36-9f5c8b6ce888" x="0" y="0" width="59" height="29" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{serAmount}]]></expression>
|
||||
<box topPadding="3" leftPadding="3" bottomPadding="0" rightPadding="0">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -424,9 +388,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
|
||||
</column>
|
||||
<column kind="single" uuid="3327181e-4f64-4d63-82ff-0ed2b59480cc" width="109">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="37981f61-4b25-40b0-8a0c-41bcc6ed32fa" x="0" y="0" width="109" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="3327181e-4f64-4d63-82ff-0ed2b59480cc" width="110">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="37981f61-4b25-40b0-8a0c-41bcc6ed32fa" x="0" y="0" width="110" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Đơn giá (VND)]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -437,7 +401,7 @@
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<element kind="staticText" uuid="3b9fa332-aed6-4fa5-936b-8de4b1e1bae0" x="0" y="0" width="109" height="30" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left" vTextAlign="Top">
|
||||
<element kind="staticText" uuid="3b9fa332-aed6-4fa5-936b-8de4b1e1bae0" x="0" y="0" width="110" height="30" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left" vTextAlign="Top">
|
||||
<text><![CDATA[Tổng tiền dịch vụ:]]></text>
|
||||
<box topPadding="3" leftPadding="3"/>
|
||||
</element>
|
||||
@@ -449,7 +413,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="6bf24316-39cd-4805-8548-52ea9d23818e" x="0" y="0" width="109" height="29" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<element kind="textField" uuid="6bf24316-39cd-4805-8548-52ea9d23818e" x="0" y="0" width="110" height="29" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{serUnitPrice}]]></expression>
|
||||
<box topPadding="3" leftPadding="3" rightPadding="3">
|
||||
<pen lineWidth="1.0"/>
|
||||
@@ -468,9 +432,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
|
||||
</column>
|
||||
<column kind="single" uuid="5aca36b8-4305-428a-9311-4223d48dc96b" width="100">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="51fe5f04-3e6f-4f9c-bfbe-c9aa31e5266d" x="0" y="0" width="100" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="5aca36b8-4305-428a-9311-4223d48dc96b" width="81">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="51fe5f04-3e6f-4f9c-bfbe-c9aa31e5266d" x="0" y="0" width="81" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Thành tiền (VND)]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -481,7 +445,7 @@
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<element kind="textField" uuid="a0606f4b-6dad-47cd-b470-f401e298612e" x="0" y="0" width="100" height="30" pattern="#,##0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<element kind="textField" uuid="a0606f4b-6dad-47cd-b470-f401e298612e" x="0" y="0" width="81" height="30" pattern="#,##0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<expression><![CDATA[$V{serTotal}]]></expression>
|
||||
<box topPadding="3" rightPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -498,7 +462,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="29" style="Table_TD">
|
||||
<element kind="textField" uuid="035cfa1b-9187-4bfe-8fa1-1d149d789768" x="0" y="0" width="100" height="29" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<element kind="textField" uuid="035cfa1b-9187-4bfe-8fa1-1d149d789768" x="0" y="0" width="81" height="29" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<expression><![CDATA[$V{serRowTotal}]]></expression>
|
||||
<box topPadding="3" leftPadding="0" rightPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -527,22 +491,22 @@
|
||||
</group>
|
||||
<group name="group_thucphambosung">
|
||||
<groupHeader>
|
||||
<band height="103">
|
||||
<band height="88">
|
||||
<printWhenExpression><![CDATA[$P{hasSupplements}]]></printWhenExpression>
|
||||
<element kind="staticText" uuid="6d6dde35-8321-4fa0-9c3c-d958b1746883" positionType="Float" x="211" y="1" width="161" height="19" fontSize="14.0" bold="true" hTextAlign="Center">
|
||||
<element kind="staticText" uuid="6d6dde35-8321-4fa0-9c3c-d958b1746883" positionType="Float" x="211" y="1" width="161" height="19" fontName="Times New Roman" fontSize="14.0" bold="true" hTextAlign="Center">
|
||||
<printWhenExpression><![CDATA[$P{hasSupplements}]]></printWhenExpression>
|
||||
<text><![CDATA[THỰC PHẨM BỔ SUNG]]></text>
|
||||
</element>
|
||||
<element kind="component" uuid="1e772fe4-c438-49a7-9c8d-80acc5179879" positionType="Float" x="10" y="19" width="539" height="79">
|
||||
<element kind="component" uuid="1e772fe4-c438-49a7-9c8d-80acc5179879" positionType="Float" x="10" y="19" width="539" height="69">
|
||||
<printWhenExpression><![CDATA[$P{hasSupplements}]]></printWhenExpression>
|
||||
<component kind="table">
|
||||
<datasetRun uuid="b5f5d7d0-20c6-4715-940e-fc9269e059c4" subDataset="med_pre">
|
||||
<dataSourceExpression><![CDATA[$P{supplementDS}]]></dataSourceExpression>
|
||||
<returnValue toVariable="SupplementGrandTotal" fromVariable="supTotal"/>
|
||||
</datasetRun>
|
||||
<column kind="single" uuid="c56e4696-b21a-4640-a3ca-b528622c7c86" width="160">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="5ac78482-8ead-4d65-8232-92426efbcb34" stretchType="NoStretch" x="0" y="0" width="160" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="c56e4696-b21a-4640-a3ca-b528622c7c86" width="300">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="5ac78482-8ead-4d65-8232-92426efbcb34" stretchType="NoStretch" x="0" y="0" width="300" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Tên sản phẩm]]></text>
|
||||
<property name="com.jaspersoft.studio.unit.height" value="px"/>
|
||||
<box>
|
||||
@@ -552,6 +516,7 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<property name="com.jaspersoft.studio.unit.height" value="px"/>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
|
||||
@@ -563,7 +528,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="d5ea8862-e0b9-46d9-a53c-c10aca930651" x="0" y="0" width="160" height="15" fontName="Arial" fontSize="8.0" hTextAlign="Left" vTextAlign="Top">
|
||||
<element kind="textField" uuid="d5ea8862-e0b9-46d9-a53c-c10aca930651" x="0" y="0" width="300" height="15" fontName="Arial" fontSize="8.0" hTextAlign="Left" vTextAlign="Top">
|
||||
<expression><![CDATA[$F{supName}]]></expression>
|
||||
<box topPadding="3" leftPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -572,8 +537,8 @@
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<element kind="textField" uuid="5bf931d8-5fc9-4ad0-9a88-ce5fb7874edd" x="0" y="15" width="160" height="15" fontName="Arial" fontSize="8.0" italic="true">
|
||||
<expression><![CDATA["Ghi chú: " + $F{supNote}]]></expression>
|
||||
<element kind="textField" uuid="5bf931d8-5fc9-4ad0-9a88-ce5fb7874edd" x="0" y="15" width="300" height="15" fontName="Arial" fontSize="8.0" italic="true">
|
||||
<expression><![CDATA["Ghi chú: " + $F{supNote} + ", " + $F{supDosage}]]></expression>
|
||||
<box leftPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -590,49 +555,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
|
||||
</column>
|
||||
<column kind="single" uuid="ed772a4b-c595-416c-89c4-adc8f03f8bbb" width="90">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="931a3eba-7d94-4d55-9584-ef03aef45f85" x="0" y="0" width="90" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Liều dùng]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="76c3a08d-98e3-44ad-8422-24a953ce06d6" x="0" y="0" width="90" height="30" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{supDosage}]]></expression>
|
||||
<box topPadding="3" leftPadding="3">
|
||||
<pen lineWidth="1.0"/>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</element>
|
||||
<box style="Table_TD">
|
||||
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
</box>
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
|
||||
</column>
|
||||
<column kind="single" uuid="896672c4-8128-4e60-b52a-4469dff9bc37" width="80">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="dec34657-b22a-42b0-b8f6-54c2d0b557b7" x="0" y="0" width="80" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="896672c4-8128-4e60-b52a-4469dff9bc37" width="50">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="dec34657-b22a-42b0-b8f6-54c2d0b557b7" x="0" y="0" width="50" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[SL]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -651,7 +576,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="b0d84fb4-a5d8-4b2d-89c0-f082afe51ef3" x="0" y="0" width="80" height="30" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<element kind="textField" uuid="b0d84fb4-a5d8-4b2d-89c0-f082afe51ef3" x="0" y="0" width="50" height="30" fontName="Arial" fontSize="8.0" hTextAlign="Center" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{supAmount}]]></expression>
|
||||
<box topPadding="3" leftPadding="3" bottomPadding="0" rightPadding="0">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -669,9 +594,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
|
||||
</column>
|
||||
<column kind="single" uuid="b39552ea-7133-415f-9651-ab70891e8c3b" width="99">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="6ccc7d95-8eb4-45dd-990a-405dbdd76460" x="0" y="0" width="99" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="b39552ea-7133-415f-9651-ab70891e8c3b" width="100">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="6ccc7d95-8eb4-45dd-990a-405dbdd76460" x="0" y="0" width="100" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Đơn giá (VND)]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -682,7 +607,7 @@
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<element kind="staticText" uuid="9507b170-f15d-4fc1-92d0-afdff63314dc" x="0" y="0" width="99" height="30" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left" vTextAlign="Top">
|
||||
<element kind="staticText" uuid="9507b170-f15d-4fc1-92d0-afdff63314dc" x="0" y="0" width="100" height="30" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left" vTextAlign="Top">
|
||||
<text><![CDATA[Tổng tiền thuốc:]]></text>
|
||||
<box topPadding="3" leftPadding="3"/>
|
||||
</element>
|
||||
@@ -694,7 +619,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="b2a7a96b-2dfa-4e45-80fb-a539e558c7f7" x="0" y="0" width="99" height="30" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<element kind="textField" uuid="b2a7a96b-2dfa-4e45-80fb-a539e558c7f7" x="0" y="0" width="100" height="30" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<expression><![CDATA[$F{supUnitPrice}]]></expression>
|
||||
<box topPadding="3" leftPadding="3" rightPadding="3">
|
||||
<pen lineWidth="1.0"/>
|
||||
@@ -713,9 +638,9 @@
|
||||
</detailCell>
|
||||
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
|
||||
</column>
|
||||
<column kind="single" uuid="37250740-3d62-4dc1-800d-eb943da0388e" width="110">
|
||||
<columnHeader height="20" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="5c61209b-8409-4ba2-979e-f52e49eb0b00" x="0" y="0" width="110" height="20" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<column kind="single" uuid="37250740-3d62-4dc1-800d-eb943da0388e" width="89">
|
||||
<columnHeader height="15" rowSpan="1" style="Table_CH">
|
||||
<element kind="staticText" uuid="5c61209b-8409-4ba2-979e-f52e49eb0b00" x="0" y="0" width="89" height="15" fontName="Arial" hTextAlign="Center" vTextAlign="Middle">
|
||||
<text><![CDATA[Thành tiền (VND)]]></text>
|
||||
<box>
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -726,7 +651,7 @@
|
||||
</element>
|
||||
</columnHeader>
|
||||
<columnFooter height="30" rowSpan="1">
|
||||
<element kind="textField" uuid="f0e1b6cf-c081-4483-ab9c-a9112960858d" x="0" y="0" width="110" height="30" pattern="#,##0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<element kind="textField" uuid="f0e1b6cf-c081-4483-ab9c-a9112960858d" x="0" y="0" width="89" height="30" pattern="#,##0" bold="true" hTextAlign="Right" vTextAlign="Top">
|
||||
<expression><![CDATA[$V{supTotal}]]></expression>
|
||||
<box topPadding="3" rightPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -743,7 +668,7 @@
|
||||
</box>
|
||||
</columnFooter>
|
||||
<detailCell height="30" style="Table_TD">
|
||||
<element kind="textField" uuid="b46cdc11-d0af-4436-a554-b9c38613f07a" x="0" y="0" width="110" height="30" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<element kind="textField" uuid="b46cdc11-d0af-4436-a554-b9c38613f07a" x="0" y="0" width="89" height="30" fontName="Arial" fontSize="8.0" pattern="#,##0" hTextAlign="Right" vTextAlign="Middle">
|
||||
<expression><![CDATA[$V{supRowTotal}]]></expression>
|
||||
<box topPadding="3" leftPadding="0" rightPadding="3">
|
||||
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
|
||||
@@ -775,19 +700,19 @@
|
||||
<element kind="image" uuid="c596ac6f-18d9-4cfe-a74e-58b1f7d11ecc" x="-10" y="-4" width="90" height="83">
|
||||
<expression><![CDATA[$P{logoImage}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="48bf4793-8d8d-427d-b739-8f34f051192f" x="80" y="-4" width="350" height="25" fontName="Arial" fontSize="18.0" bold="true">
|
||||
<expression><![CDATA["PHÒNG KHÁM " + $P{clinicName}]]></expression>
|
||||
<element kind="textField" uuid="48bf4793-8d8d-427d-b739-8f34f051192f" x="80" y="-4" width="350" height="25" fontName="Times New Roman" fontSize="18.0" bold="true">
|
||||
<expression><![CDATA[$P{clinicName}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="d8e95ce7-3ac0-44a7-ac8f-65821b7f373c" x="80" y="20" width="150" height="15" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="d8e95ce7-3ac0-44a7-ac8f-65821b7f373c" x="80" y="20" width="150" height="15" fontName="Times New Roman" fontSize="12.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Địa chỉ: ]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="9883203e-fd4b-4110-a4b9-2c8c257ce5fa" x="126" y="20" width="346" height="15" fontName="Arial" fontSize="12.0">
|
||||
<element kind="textField" uuid="9883203e-fd4b-4110-a4b9-2c8c257ce5fa" x="126" y="20" width="346" height="15" fontName="Times New Roman" fontSize="12.0">
|
||||
<expression><![CDATA[$P{clinicAddress}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="f00706ca-903c-4089-b3a1-33be68f6112b" x="80" y="36" width="150" height="15" fontName="Arial" fontSize="12.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="f00706ca-903c-4089-b3a1-33be68f6112b" x="80" y="36" width="150" height="15" fontName="Times New Roman" fontSize="12.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[SĐT:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="2af00e22-702e-42cb-a6fb-19d401a58170" x="110" y="36" width="362" height="15" fontName="Arial" fontSize="12.0">
|
||||
<element kind="textField" uuid="2af00e22-702e-42cb-a6fb-19d401a58170" x="110" y="36" width="362" height="15" fontName="Times New Roman" fontSize="12.0">
|
||||
<expression><![CDATA[$P{clinicPhone}]]></expression>
|
||||
</element>
|
||||
<element kind="component" uuid="35037abf-0984-4b9e-8a05-f8fae38d7dcc" x="476" y="21" width="79" height="48">
|
||||
@@ -795,85 +720,85 @@
|
||||
<codeExpression><![CDATA[$P{barcodeNumber}]]></codeExpression>
|
||||
</component>
|
||||
</element>
|
||||
<element kind="staticText" uuid="aef24b29-b2af-4cdb-b230-d2acd3ce2892" x="472" y="10" width="80" height="25" fontName="Arial" fontSize="10.0" bold="false" hTextAlign="Center">
|
||||
<element kind="staticText" uuid="aef24b29-b2af-4cdb-b230-d2acd3ce2892" x="472" y="10" width="80" height="25" fontName="Times New Roman" fontSize="10.0" bold="false" hTextAlign="Center">
|
||||
<text><![CDATA[Mã khám bệnh]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="de38fb46-49af-4f48-8c33-f97680bcc7fa" x="192" y="54" width="180" height="25" fontName="Arial" fontSize="18.0" bold="true" hTextAlign="Center">
|
||||
<text><![CDATA[TOA THUỐC]]></text>
|
||||
<element kind="staticText" uuid="de38fb46-49af-4f48-8c33-f97680bcc7fa" x="135" y="54" width="284" height="25" fontName="Times New Roman" fontSize="18.0" bold="true" hTextAlign="Center">
|
||||
<text><![CDATA[TOA THUỐC & DỊCH VỤ]]></text>
|
||||
</element>
|
||||
</title>
|
||||
<pageHeader height="110" splitType="Stretch">
|
||||
<element kind="staticText" uuid="68240a36-0b2b-4bc9-aee9-ab6c4ec19f7c" x="0" y="1" width="50" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<pageHeader height="72" splitType="Stretch">
|
||||
<element kind="staticText" uuid="e6997cbd-6cea-4ab2-ab14-402c6487566b" x="0" y="5" width="50" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Họ và tên:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="fbfab342-b9df-417d-8341-38a547f80561" x="0" y="16" width="80" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="3dc3cfae-fb07-4ee2-a477-9e14e1a88a55" x="0" y="18" width="80" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Ngày sinh:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="5902f022-60d4-4924-88bb-c3f5bc010212" x="0" y="31" width="80" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="1c26d386-0d3f-4e81-80b7-19e6d99c8bb6" x="140" y="18" width="80" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Giới tính:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="7c27a754-d81f-4411-be00-7ee575cc12e8" x="0" y="46" width="80" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="0d2b2914-3291-41e1-b026-6258b8b7c9bc" x="0" y="32" width="49" height="15" fontName="Times New Roman" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Địa chỉ:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="089f23f2-b1f5-4102-89a4-b11bfa1ff468" x="320" y="1" width="50" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="4da3f19a-8dcb-4a94-b1c0-68ad61615197" x="274" y="4" width="50" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Bác sĩ:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="f6b2d15b-04a1-44ed-b72e-bd9e364ed248" x="320" y="16" width="60" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="9b7c5e15-fd8b-4314-8941-863bf39db57d" x="274" y="18" width="60" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Ngày khám:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="7b2f5efd-dda7-4233-8f6d-e54a425f6ef6" x="0" y="81" width="80" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Chuẩn đoán:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="23013729-cb89-46b8-b956-7be6bfd2a010" x="320" y="32" width="80" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Ghi chú:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="7e27e979-69d3-475c-ad48-5b71030a6eae" x="60" y="1" width="260" height="15" fontName="Arial">
|
||||
<element kind="textField" uuid="f2f20167-fbd0-47d5-a7ce-03d7da78f342" x="60" y="5" width="214" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientName}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="ff99dc8c-8477-49d7-8206-344463437478" x="60" y="16" width="260" height="15" fontName="Arial">
|
||||
<element kind="textField" uuid="46ef6929-7796-4d92-9478-8ed269d8708f" x="60" y="18" width="80" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientDOB}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="19536fc9-be78-46dc-8891-a7c1e6108498" x="60" y="32" width="260" height="15" fontName="Arial">
|
||||
<element kind="textField" uuid="2f307864-3cbc-4110-8d5a-34d78080a316" x="184" y="18" width="46" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientGender}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="a942834e-78fb-4975-ba71-331948e92d65" x="60" y="47" width="260" height="33" fontName="Arial">
|
||||
<element kind="textField" uuid="3e0c0023-37b8-490a-b839-ba0a50fb1629" x="60" y="32" width="214" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientAddress}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="4154fffa-29ed-4d89-ba1f-4bb490626135" x="380" y="1" width="173" height="15" fontName="Arial">
|
||||
<element kind="textField" uuid="7ed16435-adca-4e26-aae4-4acad15ed344" x="330" y="4" width="122" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{doctorName}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="2c951dbb-1809-4aef-b3f9-1325579449b7" x="380" y="16" width="173" height="15" fontName="Arial">
|
||||
<element kind="textField" uuid="4a444f9a-544f-4ce5-b812-5704bc2bbfce" x="330" y="18" width="124" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{checkupDate}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="85f77798-f7e7-4bb0-b32f-d0cba62f3664" x="64" y="81" width="482" height="26" fontName="Arial">
|
||||
<element kind="staticText" uuid="c089f2a4-115e-4739-a0c7-7aa1e98b5c6a" x="0" y="46" width="59" height="16" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Chuẩn đoán:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="d44e5d8d-1ebd-45e3-a8bd-941e1c2a1392" x="60" y="46" width="214" height="26" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientDiagnos}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="3d2ad8af-d76e-4191-8c49-38535da8bda1" x="380" y="32" width="173" height="28" fontName="Arial">
|
||||
<element kind="staticText" uuid="7890cf52-9226-4382-a90c-82c8477341d7" x="274" y="32" width="59" height="16" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Ghi chú:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="941f1796-cbf9-4888-97bd-9a5d3fe369d8" x="330" y="32" width="190" height="26" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{checkupNote}]]></expression>
|
||||
</element>
|
||||
</pageHeader>
|
||||
<pageFooter height="22" splitType="Stretch">
|
||||
<element kind="textField" uuid="6bf56eff-9df3-4dbc-a46f-ed2169078f76" x="300" y="1" width="252" height="19" pattern="MMMMM dd, yyyy" hTextAlign="Right" vTextAlign="Bottom">
|
||||
<element kind="textField" uuid="6bf56eff-9df3-4dbc-a46f-ed2169078f76" x="300" y="1" width="252" height="19" fontName="Times New Roman" pattern="MMMMM dd, yyyy" hTextAlign="Right" vTextAlign="Bottom">
|
||||
<expression><![CDATA[new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm").format(new java.util.Date()) + " | Trang " + $V{PAGE_NUMBER}]]></expression>
|
||||
</element>
|
||||
</pageFooter>
|
||||
<summary height="149" splitType="Stretch">
|
||||
<element kind="staticText" uuid="f6d652a5-b593-4ee5-96a2-a4886beb7483" x="240" y="15" width="280" height="30" fontName="Arial" fontSize="16.0" bold="true">
|
||||
<summary height="128" splitType="Stretch">
|
||||
<element kind="staticText" uuid="f6d652a5-b593-4ee5-96a2-a4886beb7483" x="240" y="15" width="280" height="30" fontName="Times New Roman" fontSize="16.0" bold="true">
|
||||
<text><![CDATA[Tổng cộng thanh toán:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="f53358c4-1118-484a-968d-cf3fa2f55f3c" x="446" y="15" width="100" height="30" fontName="Arial" fontSize="16.0" evaluationTime="Report" pattern="#,##0" bold="true" hTextAlign="Right">
|
||||
<element kind="textField" uuid="f53358c4-1118-484a-968d-cf3fa2f55f3c" x="446" y="15" width="100" height="30" fontName="Times New Roman" fontSize="16.0" evaluationTime="Report" pattern="#,##0" bold="true" hTextAlign="Right">
|
||||
<expression><![CDATA[$V{MedicineGrandTotal}.add($V{ServiceGrandTotal}).add($V{SupplementGrandTotal})]]></expression>
|
||||
</element>
|
||||
<element kind="line" uuid="cc682c03-bd3f-480a-a69c-a7c56e855a7d" x="110" y="6" width="450" height="1">
|
||||
<pen lineWidth="1.0"/>
|
||||
</element>
|
||||
<element kind="staticText" uuid="4884d0d3-eb98-4fd9-865c-a0d39f14ddce" x="376" y="37" width="70" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="4884d0d3-eb98-4fd9-865c-a0d39f14ddce" x="376" y="37" width="70" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Bác sĩ ghi toa:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="7430fd89-6565-41e6-a25a-619a9ab8f788" x="323" y="116" width="176" height="15" fontName="Arial" hTextAlign="Center">
|
||||
<element kind="textField" uuid="7430fd89-6565-41e6-a25a-619a9ab8f788" x="323" y="97" width="176" height="15" fontName="Times New Roman" fontSize="12.0" bold="true" hTextAlign="Center">
|
||||
<expression><![CDATA[$P{doctorName}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="0324ca00-fa26-42c4-a87b-4bac3fa6db7c" x="285" y="127" width="252" height="19" pattern="MMMMM dd, yyyy" hTextAlign="Center" vTextAlign="Bottom">
|
||||
<element kind="textField" uuid="0324ca00-fa26-42c4-a87b-4bac3fa6db7c" x="285" y="108" width="252" height="19" fontName="Times New Roman" pattern="MMMMM dd, yyyy" hTextAlign="Center" vTextAlign="Bottom">
|
||||
<expression><![CDATA[new java.text.SimpleDateFormat("'Đức Hoà, ngày ' dd ' tháng ' MM ' năm ' yyyy", new java.util.Locale("vi", "VN")).format(new java.util.Date())]]></expression>
|
||||
</element>
|
||||
</summary>
|
||||
|
||||
+5
@@ -57,6 +57,11 @@ public class test_print {
|
||||
parameters.put("serviceDS", serviceDS);
|
||||
parameters.put("supplementDS", supplementDS);
|
||||
|
||||
// Add boolean flags to control table visibility based on data presence
|
||||
parameters.put("hasMedicines", !medicines.isEmpty());
|
||||
parameters.put("hasServices", !services.isEmpty());
|
||||
parameters.put("hasSupplements", !supplements.isEmpty());
|
||||
|
||||
// Set locale to Vietnamese for number formatting
|
||||
parameters.put(JRParameter.REPORT_LOCALE, new Locale("vi", "VN"));
|
||||
|
||||
|
||||
+33
-31
@@ -46,112 +46,114 @@
|
||||
<pageHeader splitType="Stretch"/>
|
||||
<columnHeader splitType="Stretch"/>
|
||||
<detail>
|
||||
<band height="527" splitType="Stretch">
|
||||
<band height="540" splitType="Stretch">
|
||||
<element kind="frame" uuid="2b7ec588-953c-4145-87b7-1d861c272fe0" x="0" y="0" width="400" height="525">
|
||||
<element kind="image" uuid="fd80ab38-4cae-409b-84b9-356220d2b1e5" x="0" y="-5" width="70" height="64">
|
||||
<expression><![CDATA[$P{logoImage}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="eb56d4c8-2a0d-45fa-89a2-ad6528f9a99b" x="70" y="0" width="300" height="20" fontName="Arial" fontSize="14.0" bold="true">
|
||||
<expression><![CDATA["PHÒNG KHÁM " + $P{clinicName}]]></expression>
|
||||
<element kind="textField" uuid="eb56d4c8-2a0d-45fa-89a2-ad6528f9a99b" x="70" y="0" width="267" height="20" fontName="Times New Roman" fontSize="14.0" bold="true">
|
||||
<expression><![CDATA[$P{clinicName}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="2677daaf-d0fb-40ad-afaa-513efa16055c" x="70" y="20" width="150" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="2677daaf-d0fb-40ad-afaa-513efa16055c" x="70" y="20" width="150" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Địa chỉ: ]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="796d9ffd-6d2e-4ae3-bdfb-b08183d7d9c0" x="100" y="20" width="270" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="796d9ffd-6d2e-4ae3-bdfb-b08183d7d9c0" x="106" y="20" width="231" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{clinicAddress}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="1a1405ee-b3e4-4e98-ac08-6818bc29e902" x="70" y="36" width="150" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="1a1405ee-b3e4-4e98-ac08-6818bc29e902" x="70" y="36" width="150" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[SĐT:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="260bb33d-1d11-4178-aceb-3fbf8fcb4b45" x="100" y="36" width="270" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="260bb33d-1d11-4178-aceb-3fbf8fcb4b45" x="106" y="36" width="231" height="15" fontName="Times New Roman" fontSize="8.0">
|
||||
<expression><![CDATA[$P{clinicPhone}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="6f89a93f-2d10-4506-baa5-226bdd047b17" x="0" y="59" width="100" height="30" forecolor="#FF0905" fontName="Times New Roman" fontSize="15.0" bold="true">
|
||||
<text><![CDATA[I.Thông tin]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="b8dfca43-cf97-49e5-b58d-4667143dba62" x="0" y="79" width="50" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="b8dfca43-cf97-49e5-b58d-4667143dba62" x="0" y="79" width="50" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Họ và tên:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="0a9ca0c8-f2bd-4ade-a025-a6d79c13613f" x="1" y="94" width="80" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="0a9ca0c8-f2bd-4ade-a025-a6d79c13613f" x="1" y="94" width="80" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Ngày sinh:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="21917ab8-ae07-44c8-ba4e-bc6c4c54b440" x="148" y="94" width="80" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="21917ab8-ae07-44c8-ba4e-bc6c4c54b440" x="140" y="94" width="80" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Giới tính:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="bcbb614e-7a4d-48a3-83c2-198e4fb62c5f" x="1" y="109" width="80" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="bcbb614e-7a4d-48a3-83c2-198e4fb62c5f" x="1" y="109" width="49" height="15" fontName="Times New Roman" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Địa chỉ:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="45fe4be1-9e21-459b-aeee-2efc8354f372" x="221" y="80" width="50" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="45fe4be1-9e21-459b-aeee-2efc8354f372" x="221" y="80" width="50" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Bác sĩ:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="f2ff4b17-63cc-4e8c-a3b0-2523f534f21a" x="221" y="94" width="60" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="f2ff4b17-63cc-4e8c-a3b0-2523f534f21a" x="221" y="94" width="60" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Ngày khám:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="1511f53a-b282-41b1-b233-612b6106c07a" x="50" y="79" width="180" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="1511f53a-b282-41b1-b233-612b6106c07a" x="60" y="79" width="161" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientName}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="5bdac267-523d-4931-926b-76233ce9b84d" x="50" y="94" width="98" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="5bdac267-523d-4931-926b-76233ce9b84d" x="60" y="94" width="80" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientDOB}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="f4df20b4-920c-491e-882b-6e0733cb4866" x="186" y="94" width="44" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="f4df20b4-920c-491e-882b-6e0733cb4866" x="184" y="94" width="36" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientGender}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="3b8ac40e-85aa-4ab8-8445-64bcddb8b267" x="50" y="110" width="200" height="20" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="3b8ac40e-85aa-4ab8-8445-64bcddb8b267" x="60" y="109" width="200" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientAddress}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="db40cdb0-2850-4d66-8430-addc54f90321" x="266" y="80" width="134" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="db40cdb0-2850-4d66-8430-addc54f90321" x="277" y="80" width="122" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{doctorName}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="eb9cf54a-3b50-43c5-8696-cfc1e21bddfe" x="266" y="94" width="134" height="15" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="eb9cf54a-3b50-43c5-8696-cfc1e21bddfe" x="276" y="94" width="124" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{checkupDate}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="9f7de81c-4c38-41a2-9fea-a165eff19431" x="1" y="130" width="49" height="15" fontName="Arial" fontSize="8.0" bold="true" hTextAlign="Left">
|
||||
<element kind="staticText" uuid="9f7de81c-4c38-41a2-9fea-a165eff19431" x="1" y="124" width="59" height="16" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Left">
|
||||
<text><![CDATA[Chuẩn đoán:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="5ae67e13-7a79-437f-bfb8-c720d896720d" x="51" y="130" width="349" height="26" fontName="Arial" fontSize="8.0">
|
||||
<element kind="textField" uuid="5ae67e13-7a79-437f-bfb8-c720d896720d" x="60" y="124" width="340" height="26" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{patientDiagnos}]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="b1fa845a-48da-4e45-82b8-8b9d972650f6" x="0" y="156" width="100" height="30" forecolor="#FF0905" fontName="Times New Roman" fontSize="15.0" bold="true">
|
||||
<element kind="staticText" uuid="b1fa845a-48da-4e45-82b8-8b9d972650f6" x="0" y="146" width="100" height="30" forecolor="#FF0905" fontName="Times New Roman" fontSize="15.0" bold="true">
|
||||
<text><![CDATA[II.Nội dung]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="6d652a25-b701-45bd-91ba-750842650004" x="0" y="176" width="400" height="348" markup="rtf" fontName="Times New Roman" fontSize="10.0">
|
||||
<element kind="textField" uuid="6d652a25-b701-45bd-91ba-750842650004" x="0" y="164" width="400" height="376" markup="rtf" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{checkupNote}]]></expression>
|
||||
</element>
|
||||
</element>
|
||||
<element kind="frame" uuid="a72ffc70-007e-43af-a566-b34e6e07b312" x="400" y="0" width="400" height="526">
|
||||
<element kind="frame" uuid="a72ffc70-007e-43af-a566-b34e6e07b312" x="400" y="0" width="400" height="540">
|
||||
<element kind="staticText" uuid="246a04b0-2565-4987-b7f3-dd369703035c" x="0" y="340" width="100" height="30" forecolor="#FF0905" fontName="Times New Roman" fontSize="15.0" bold="true">
|
||||
<text><![CDATA[III.Kết luận]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="c53ef0ab-a702-47fc-9b7c-24307a495b30" x="0" y="430" width="100" height="30" forecolor="#FF0905" fontName="Times New Roman" fontSize="15.0" bold="true">
|
||||
<text><![CDATA[Đề nghị:]]></text>
|
||||
</element>
|
||||
<element kind="staticText" uuid="a38b1187-ddb8-4410-9b52-dc041f894b7b" x="247" y="430" width="96" height="15" fontName="Arial" fontSize="10.0" bold="true" hTextAlign="Center">
|
||||
<element kind="staticText" uuid="a38b1187-ddb8-4410-9b52-dc041f894b7b" x="247" y="442" width="96" height="15" fontName="Times New Roman" fontSize="10.0" bold="true" hTextAlign="Center">
|
||||
<text><![CDATA[Bác sĩ siêu âm]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="b548d99d-bedf-4e90-b13b-bdbc763aa974" x="230" y="496" width="132" height="15" fontName="Arial" hTextAlign="Center">
|
||||
<element kind="textField" uuid="b548d99d-bedf-4e90-b13b-bdbc763aa974" x="200" y="516" width="200" height="15" fontName="Times New Roman" fontSize="12.0" bold="true" hTextAlign="Center">
|
||||
<expression><![CDATA[$P{doctorName}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="8bca58ab-0958-40fe-8e51-2a39a9d379a5" x="200" y="506" width="200" height="19" pattern="MMMMM dd, yyyy" hTextAlign="Center" vTextAlign="Bottom">
|
||||
<element kind="textField" uuid="8bca58ab-0958-40fe-8e51-2a39a9d379a5" x="200" y="521" width="200" height="19" fontName="Times New Roman" pattern="MMMMM dd, yyyy" hTextAlign="Center" vTextAlign="Bottom">
|
||||
<expression><![CDATA[new java.text.SimpleDateFormat("'Đức Hoà, ngày ' dd ' tháng ' MM ' năm ' yyyy", new java.util.Locale("vi", "VN")).format(new java.util.Date())]]></expression>
|
||||
</element>
|
||||
<element kind="staticText" uuid="c062ce0e-80cb-4e67-a5d9-d85e769c6c4e" x="0" y="511" width="110" height="14" forecolor="#FF0905" fontName="Times New Roman" fontSize="10.0" bold="true">
|
||||
<element kind="staticText" uuid="c062ce0e-80cb-4e67-a5d9-d85e769c6c4e" x="0" y="525" width="110" height="14" forecolor="#FF0905" fontName="Times New Roman" fontSize="10.0" bold="true">
|
||||
<text><![CDATA[Tái khám:]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="e90ad772-4425-482d-9e75-f2bc66b9084d" x="0" y="358" width="400" height="70" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{checkupConclusion}]]></expression>
|
||||
</element>
|
||||
<element kind="component" uuid="cb28d811-1328-45dc-9461-cfbb88b7eeae" x="-59" y="12" width="60" height="40">
|
||||
<element kind="component" uuid="cb28d811-1328-45dc-9461-cfbb88b7eeae" x="-63" y="13" width="60" height="40">
|
||||
<printWhenExpression><![CDATA[$P{barcodeNumber} != null && !$P{barcodeNumber}.isEmpty()]]></printWhenExpression>
|
||||
<component kind="barcode4j:Code128">
|
||||
<codeExpression><![CDATA[$P{barcodeNumber}]]></codeExpression>
|
||||
</component>
|
||||
</element>
|
||||
<element kind="staticText" uuid="6a7d5f66-d7cc-481f-9fff-8ece0789b3b4" x="-60" y="2" width="61" height="17" fontName="Arial" fontSize="10.0" bold="false" hTextAlign="Center">
|
||||
<element kind="staticText" uuid="6a7d5f66-d7cc-481f-9fff-8ece0789b3b4" x="-63" y="2" width="61" height="17" fontName="Times New Roman" fontSize="10.0" bold="false" hTextAlign="Center">
|
||||
<printWhenExpression><![CDATA[$P{barcodeNumber} != null && !$P{barcodeNumber}.isEmpty()]]></printWhenExpression>
|
||||
<text><![CDATA[Mã khám bệnh]]></text>
|
||||
</element>
|
||||
<element kind="textField" uuid="d63165c2-19e2-43ad-8a3f-004e00bffdfe" x="0" y="450" width="230" height="55" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{checkupSuggestion}]]></expression>
|
||||
</element>
|
||||
<element kind="textField" uuid="cece8e5b-67db-4019-b52a-bf73abae535e" x="46" y="514" width="150" height="15" fontName="Times New Roman" fontSize="8.0">
|
||||
<element kind="textField" uuid="cece8e5b-67db-4019-b52a-bf73abae535e" x="48" y="525" width="150" height="15" fontName="Times New Roman" fontSize="10.0">
|
||||
<expression><![CDATA[$P{reCheckupDate}]]></expression>
|
||||
</element>
|
||||
<element kind="frame" uuid="2f301804-acfa-4b6f-9f52-236c04fd1197" x="0" y="0" width="400" height="344">
|
||||
|
||||
+33
-12
@@ -31,6 +31,9 @@ import BsK.client.network.handler.ClientHandler;
|
||||
import BsK.client.network.handler.ResponseListener;
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
import javax.swing.SpinnerModel;
|
||||
import javax.swing.SpinnerNumberModel;
|
||||
import javax.swing.JColorChooser;
|
||||
|
||||
@Slf4j
|
||||
public class TemplateDialog extends JDialog {
|
||||
@@ -348,18 +351,18 @@ public class TemplateDialog extends JDialog {
|
||||
contentToolbar.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
|
||||
contentToolbar.setBackground(new Color(245, 245, 245));
|
||||
|
||||
// Font size combobox
|
||||
String[] sizes = {"12", "14", "16", "18", "20", "24"};
|
||||
JComboBox<String> sizeComboBox = new JComboBox<>(sizes);
|
||||
sizeComboBox.setSelectedItem("16");
|
||||
sizeComboBox.setFont(new Font("Arial", Font.PLAIN, 12));
|
||||
sizeComboBox.setToolTipText("Cỡ chữ");
|
||||
sizeComboBox.setPreferredSize(new Dimension(60, 25));
|
||||
sizeComboBox.addActionListener(e -> {
|
||||
String size = (String) sizeComboBox.getSelectedItem();
|
||||
if (size != null) {
|
||||
// Font family selector
|
||||
String[] fontFamilies = {"Arial", "Times New Roman", "Verdana", "Courier New", "Tahoma", "Calibri"};
|
||||
JComboBox<String> fontFamilyComboBox = new JComboBox<>(fontFamilies);
|
||||
fontFamilyComboBox.setSelectedItem("Times New Roman");
|
||||
fontFamilyComboBox.setFont(new Font("Arial", Font.PLAIN, 12));
|
||||
fontFamilyComboBox.setToolTipText("Phông chữ");
|
||||
fontFamilyComboBox.setPreferredSize(new Dimension(120, 25));
|
||||
fontFamilyComboBox.addActionListener(e -> {
|
||||
String fontFamily = (String) fontFamilyComboBox.getSelectedItem();
|
||||
if (fontFamily != null) {
|
||||
MutableAttributeSet attr = new SimpleAttributeSet();
|
||||
StyleConstants.setFontSize(attr, Integer.parseInt(size));
|
||||
StyleConstants.setFontFamily(attr, fontFamily);
|
||||
contentRTFField.getStyledDocument().setCharacterAttributes(
|
||||
contentRTFField.getSelectionStart(),
|
||||
contentRTFField.getSelectionEnd() - contentRTFField.getSelectionStart(),
|
||||
@@ -367,6 +370,22 @@ public class TemplateDialog extends JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
// Font size spinner
|
||||
SpinnerModel sizeModel = new SpinnerNumberModel(20, 8, 72, 2); // Default 20, min 8, max 72, step 2
|
||||
JSpinner sizeSpinner = new JSpinner(sizeModel);
|
||||
sizeSpinner.setFont(new Font("Arial", Font.PLAIN, 12));
|
||||
sizeSpinner.setToolTipText("Cỡ chữ (Cỡ chữ JasperReport = giá trị / 2)");
|
||||
sizeSpinner.setPreferredSize(new Dimension(60, 25));
|
||||
sizeSpinner.addChangeListener(e -> {
|
||||
int size = (int) sizeSpinner.getValue();
|
||||
MutableAttributeSet attr = new SimpleAttributeSet();
|
||||
StyleConstants.setFontSize(attr, size);
|
||||
contentRTFField.getStyledDocument().setCharacterAttributes(
|
||||
contentRTFField.getSelectionStart(),
|
||||
contentRTFField.getSelectionEnd() - contentRTFField.getSelectionStart(),
|
||||
attr, false);
|
||||
});
|
||||
|
||||
// Style buttons
|
||||
JButton boldButton = new JButton(new StyledEditorKit.BoldAction());
|
||||
boldButton.setText("B");
|
||||
@@ -406,7 +425,9 @@ public class TemplateDialog extends JDialog {
|
||||
|
||||
// Add components to toolbar with spacing
|
||||
contentToolbar.add(Box.createHorizontalStrut(3));
|
||||
contentToolbar.add(sizeComboBox);
|
||||
contentToolbar.add(fontFamilyComboBox);
|
||||
contentToolbar.addSeparator(new Dimension(5, 0));
|
||||
contentToolbar.add(sizeSpinner);
|
||||
contentToolbar.addSeparator(new Dimension(8, 0));
|
||||
contentToolbar.add(boldButton);
|
||||
contentToolbar.addSeparator(new Dimension(3, 0));
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user