InfantStatusViewer Documentation
Package
package vms.system;
Part of the Vaccine Management System (VMS).
Provides a Swing-based UI to view detailed vaccination status of a selected infant.
Class: InfantStatusViewer
Description
This class extends JFrame and provides a tabbed interface to view an infant’s:
1. Basic Info
2. Vaccination Records
3. Growth Monitoring
4. Immunization Status
It supports printing certificates and closing the viewer. Data is retrieved from the database
through the Connect class.
Fields
Field Type Description
The selected infant’s Medical Record
String infantMRN String
Number.
Database connection and query
Connect con Connect
handler.
Holds basic information about the
List<TableView1Model> infantInfo List
infant.
List<Dose0VaccineTypeModel> bcgInfo List Data for BCG vaccine at birth.
List<Dose0VaccineTypeModel> opv0Info List Data for OPV0 vaccine at birth.
List<Dose1VaccineTypeModel>
dose1vtInfo List Dose 1 vaccination info.
List<Dose2VaccineTypeModel>
dose2vtInfo List Dose 2 vaccination info.
List<Dose3VaccineTypeModel>
dose3vtInfo List Dose 3 vaccination info.
Field Type Description
List<Dose4VaccineTypeModel>
dose4vtInfo List Dose 4 vaccination info.
List<Dose5VaccineTypeModel>
dose5vtInfo List Dose 5 vaccination info.
List<TableView4Model> table4Info List Growth monitoring table data.
List<Dose0Table5Model>
dose0Table5Info List Dose 0 table 5 data.
List<Dose1Table5Model>
dose1Table5Info List Dose 1 table 5 data.
List<Dose2Table5Model>
dose2Table5Info List Dose 2 table 5 data.
List<Dose3Table5Model>
dose3Table5Info List Dose 3 table 5 data.
List<Dose4Table5Model>
dose4Table5Info List Dose 4 table 5 data.
List<Dose5Table5Model>
dose5Table5Info List Dose 5 table 5 data.
JTabbedPane tabbedPane JTabbedPane Container for tabbed sections.
JPanel basicInfoPanel JPanel Panel displaying basic infant info.
JPanel vaccinationPanel JPanel Panel displaying vaccination info.
Panel displaying growth monitoring
JPanel growthPanel JPanel
info.
JPanel immunizationPanel JPanel Panel displaying immunization status.
JButton printButton JButton Button to print infant certificate.
JButton closeButton JButton Button to close the viewer.
Constructor
public InfantStatusViewer(String infantMRN)
Initializes the viewer for a given infant MRN.
Loads all necessary data from the database using loadData().
Sets up the Swing UI using initUI().
Methods
loadData()
private void loadData()
Fetches all relevant data from the database for the selected infant:
o Basic info
o Vaccination doses (0–5)
o Growth monitoring
o Immunization status
Uses the Connect class methods like getAllDose1(infantMRN).
initUI()
private void initUI()
Configures the JFrame properties (title, size, layout, default close).
Creates a tabbed pane with sections for Basic Info, Vaccination, Growth Monitoring,
and Immunization.
Adds Print Certificate and Close buttons with action listeners.
createBasicInfoPanel()
private void createBasicInfoPanel()
Builds the Basic Info tab using a JTable.
Displays fields like:
o MRN, Name, DOB, Sex, Mother’s Name, Contact, Address, Registration Date.
Non-editable table.
Scrollable for better layout.
createVaccinationPanel()
private void createVaccinationPanel()
Builds the Vaccination tab.
Adds separate sections for each dose (Birth, 1–5).
Each section displays vaccine details using JTables.
Scrollable panel for vertical growth.
printCertificate()
private void printCertificate()
Placeholder method for printing functionality.
Intended to generate and print the infant’s vaccination certificate.
Can use java.awt.print.PrinterJob or external PDF library.
Additional Methods (expected)
createGrowthPanel() – displays growth monitoring data.
createImmunizationPanel() – displays immunization status.
addDoseSection(JPanel parent, String title, List<VaccineModel> data) –
helper method for adding each vaccine section.
Key Features
1. Tabbed Interface – separates data into intuitive sections.
2. Database Integration – all infant data is loaded from Connect.
3. Print Certificate – option to print vaccination details.
4. Responsive UI – uses JScrollPane and layout managers for readability.
5. Safe Closure – Close button disposes only this window without affecting main app.
Usage Example
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
new InfantStatusViewer("MRN12345").setVisible(true);
});
}
Opens a window with tabbed details of the infant with MRN "MRN12345".