Skip to content

Commit

Permalink
Merge branch 'subrelease' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cashlalala committed Nov 23, 2014
2 parents 77438c5 + 89b6986 commit fe77ce5
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/casemgmt/Frm_Case.java
Original file line number Diff line number Diff line change
Expand Up @@ -1115,10 +1115,13 @@ private void initComponents() {
if (caseType.equalsIgnoreCase("W")) {
pan_WoundAssessment = new Tab_WoundAssessment(caseGuid);
pan_WoundComplication = new Tab_WoundComplication(m_Pno, caseGuid,
m_RegGuid);
m_RegGuid);
jTabbedPane1.addTab(lang.getString("WOUND_ASSESSMENT"),
pan_WoundAssessment);
jTabbedPane1.addTab("Complication", pan_WoundComplication);
pan_WoundHistory = new Tab_WoundHistory(m_Pno);
jTabbedPane1.addTab(lang.getString("WOUND_HISTORY"), pan_WoundHistory);

tabs.add(pan_WoundAssessment);
tabs.add(pan_WoundComplication);
} else {
Expand Down Expand Up @@ -1461,6 +1464,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
pan_HIVComp = new Tab_HIVCase(caseGuid);
pan_HIVComp.setParent(this);
jTabbedPane1.addTab(lang.getString("HIV_TAB"), pan_HIVComp);
pan_HIVHistoryComp = new Tab_HIVHistory(this.m_Pno);
jTabbedPane1.addTab(lang.getString("HIV_HISTORY"), pan_HIVHistoryComp);
tabs.add(pan_HIVComp);
} else if (caseType.equalsIgnoreCase("W")) {
pan_Wound = new Tab_Wound(m_Pno, caseGuid, caseType);
Expand Down Expand Up @@ -1990,7 +1995,9 @@ private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIR
public Tab_Wound pan_Wound;
private Tab_Complication pan_CompliComp;
private Tab_HIVCase pan_HIVComp;
private Tab_HIVHistory pan_HIVHistoryComp;
private Tab_WoundAssessment pan_WoundAssessment;
private Tab_WoundHistory pan_WoundHistory;
private Tab_ConfirmEducation pan_ConfEdu;
private Tab_MedicineEducation pan_MedEdu;
private javax.swing.JPanel pan_Prescription;
Expand Down
142 changes: 142 additions & 0 deletions src/casemgmt/Tab_HIVHistory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
package casemgmt;

import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import cc.johnwu.sql.DBC;
import multilingual.Language;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;

public class Tab_HIVHistory extends JPanel {
private Frm_Case parent;
private static final long serialVersionUID = 1L;
private static final Language lang = Language.getInstance();
private JTable table;
private JScrollPane scrollPane;

public Tab_HIVHistory(String pNo) {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{1, 0};
gridBagLayout.rowHeights = new int[]{1, 0};
gridBagLayout.columnWeights = new double[]{0.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{0.0, Double.MIN_VALUE};
setLayout(gridBagLayout);

scrollPane = new JScrollPane();
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
gbc_scrollPane.weighty = 1.0;
gbc_scrollPane.weightx = 1.0;
gbc_scrollPane.fill = GridBagConstraints.BOTH;
gbc_scrollPane.gridx = 0;
gbc_scrollPane.gridy = 0;
add(scrollPane, gbc_scrollPane);

table = new JTable();
scrollPane.setViewportView(table);


String sql = "Select * from HIV_assessment " + "WHERE p_no = '" + pNo
+ "' ORDER BY createdatetime DESC";
ResultSet rs = null;
try {
rs = DBC.executeQuery(sql);
rs.last();
if (rs.getRow() == 0) {
table.setModel(new DefaultTableModel(
new String[][] { { "No Information." } },
new String[] { "Message" }));
} else {
int rowCount = rs.getRow();
Object[][] matrix = new Object[rowCount][32];
String[] header = new String[] { lang.getString("PHHD"),
lang.getString("PHCD"), lang.getString("PHHC"),
lang.getString("PHDM"), lang.getString("PHTYPEA"),
lang.getString("PHTYPEB"), lang.getString("PHTYPEC"),
lang.getString("PHMALIG"), lang.getString("HD"),
lang.getString("PHNS"), lang.getString("PHSMOKE"),
lang.getString("PHALCOHOLISM"), lang.getString("PHOW"),
lang.getString("PHOTHER"), lang.getString("IHHC"),
lang.getString("IHDM"), lang.getString("IHEBP"),
lang.getString("FMHHC"), lang.getString("FMHDM"),
lang.getString("FMHEBP"), lang.getString("WSVD"),
lang.getString("10SP"), lang.getString("HSIWS"),
lang.getString("IDUAGE"),
lang.getString("IDUDURATION"), lang.getString("WTD"),
lang.getString("HUID"), lang.getString("SN"),
lang.getString("SW"), lang.getString("METHADONE"),
lang.getString("STARTMETHADONE"),
lang.getString("STATICSMETHADONE"), };
rs.beforeFirst();
int i = 0;
while (rs.next()) {
matrix[i][0] = (String) rs.getString("Hypertension");
matrix[i][1] = (String) rs.getString("BrainVessel");
matrix[i][2] = (String) rs.getString("Hyperlipidemia");
matrix[i][3] = (String) rs.getString("Diabetes");
matrix[i][4] = (String) rs.getString("HepatitisA");
matrix[i][5] = (String) rs.getString("HepatitisB");
matrix[i][6] = (String) rs.getString("HepatitisC");
matrix[i][7] = (String) rs.getString("Cancer");
matrix[i][8] = (String) rs.getString("HeartDisease");
matrix[i][9] = (String) rs.getString("NephroticSyndrome");
matrix[i][10] = (String) rs.getString("Smoking");
matrix[i][11] = (String) rs.getString("Drinking");
matrix[i][12] = (String) rs.getString("OverWeight");
if (rs.getString("OtherDiseaseHistory") != null) {
matrix[i][13] = (String) rs
.getString("OtherDiseaseHistory");
} else {
matrix[i][13] = "";
}
matrix[i][14] = (String) rs.getString("SelfHPL");
matrix[i][15] = (String) rs.getString("SelfDiabetes");
matrix[i][16] = (String) rs.getString("SelfHTN");
matrix[i][17] = (String) rs.getString("DirectHPL");
matrix[i][18] = (String) rs.getString("DirectDiabetes");
matrix[i][19] = (String) rs.getString("DirectHTN");
matrix[i][20] = (String) rs.getString("HasSTD");
matrix[i][21] = (String) rs.getString("Has10ST");
matrix[i][22] = (String) rs.getString("HasOTS");
if (rs.getString("IDUAge") != null) {
matrix[i][23] = (String) rs.getString("IDUAge");
} else {
matrix[i][23] = "";
}
if (rs.getString("IDUDuration") != null) {
matrix[i][24] = (String) rs.getString("IDUDuration");
} else {
matrix[i][24] = "";
}
matrix[i][25] = (String) rs.getString("UsedDrugs");
matrix[i][26] = (String) rs.getString("UsedInjectionDrugs");
matrix[i][27] = (String) rs.getString("SharingNeedle");
matrix[i][28] = (String) rs.getString("SharingWater");
matrix[i][29] = (String) rs.getString("UsedMethadone");
if (rs.getString("FirstMethadone") != null) {
matrix[i][30] = (String) rs.getString("FirstMethadone");
} else {
matrix[i][30] = "";
}
matrix[i][31] = (String) rs.getString("MethadoneStatus");
i = i + 1;
}
table.setModel(new DefaultTableModel(matrix, header));
}

} catch (Exception e) {
e.printStackTrace();
} finally {
try {
DBC.closeConnection(rs);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
3 changes: 2 additions & 1 deletion src/casemgmt/Tab_WoundAssessment.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,13 @@ private void refreshData() {

rs = DBC.executeQuery(sql);
if (!rs.next()) {
String sqlInsert = "INSERT into wound_accessment '"+ guid + "', "
String sqlInsert = "INSERT into wound_accessment values ( '"+ guid + "', "
+ " '" + this.caseGuid + "', '" + p_no + "'";
int i = 0;
for (i = 0; i < 16; i++) {
sqlInsert = sqlInsert + ", NULL";
}
sqlInsert += ")";
DBC.executeUpdate(sqlInsert);
} else {
if (rs.getString("wound_accessment.Hypertension") != null
Expand Down
102 changes: 102 additions & 0 deletions src/casemgmt/Tab_WoundHistory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package casemgmt;

import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import cc.johnwu.sql.DBC;
import multilingual.Language;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;

public class Tab_WoundHistory extends JPanel {
private Frm_Case parent;
private static final long serialVersionUID = 1L;
private static final Language lang = Language.getInstance();
private JTable table;
private JScrollPane scrollPane;

public Tab_WoundHistory(String pNo) {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{1, 0};
gridBagLayout.rowHeights = new int[]{1, 0};
gridBagLayout.columnWeights = new double[]{0.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{0.0, Double.MIN_VALUE};
setLayout(gridBagLayout);

scrollPane = new JScrollPane();
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
gbc_scrollPane.weighty = 1.0;
gbc_scrollPane.weightx = 1.0;
gbc_scrollPane.fill = GridBagConstraints.BOTH;
gbc_scrollPane.gridx = 0;
gbc_scrollPane.gridy = 0;
add(scrollPane, gbc_scrollPane);

table = new JTable();
scrollPane.setViewportView(table);


String sql = "Select * from wound_accessment " + "WHERE p_no = '" + pNo
+ "' ORDER BY createdatetime DESC";
ResultSet rs = null;
try {
rs = DBC.executeQuery(sql);
rs.last();
if (rs.getRow() == 0) {
table.setModel(new DefaultTableModel(
new String[][] { { "No Information." } },
new String[] { "Message" }));
} else {
int rowCount = rs.getRow();
Object[][] matrix = new Object[rowCount][14];
String[] header = new String[] { lang.getString("PHHD"),
lang.getString("PHCD"), lang.getString("PHHC"),
lang.getString("PHDM"), lang.getString("PHTYPEA"),
lang.getString("PHTYPEB"), lang.getString("PHTYPEC"),
lang.getString("PHMALIG"), lang.getString("HD"),
lang.getString("PHNS"), lang.getString("PHSMOKE"),
lang.getString("PHALCOHOLISM"), lang.getString("PHOW"),
lang.getString("PHOTHER")};
rs.beforeFirst();
int i = 0;
while (rs.next()) {
matrix[i][0] = (String) rs.getString("Hypertension");
matrix[i][1] = (String) rs.getString("BrainVessel");
matrix[i][2] = (String) rs.getString("Hyperlipidemia");
matrix[i][3] = (String) rs.getString("Diabetes");
matrix[i][4] = (String) rs.getString("HepatitisA");
matrix[i][5] = (String) rs.getString("HepatitisB");
matrix[i][6] = (String) rs.getString("HepatitisC");
matrix[i][7] = (String) rs.getString("Cancer");
matrix[i][8] = (String) rs.getString("HeartDisease");
matrix[i][9] = (String) rs.getString("NephroticSyndrome");
matrix[i][10] = (String) rs.getString("Smoking");
matrix[i][11] = (String) rs.getString("Drinking");
matrix[i][12] = (String) rs.getString("OverWeight");
if (rs.getString("OtherDiseaseHistory") != null) {
matrix[i][13] = (String) rs
.getString("OtherDiseaseHistory");
} else {
matrix[i][13] = "";
}
i = i + 1;
}
table.setModel(new DefaultTableModel(matrix, header));
}

} catch (Exception e) {
e.printStackTrace();
} finally {
try {
DBC.closeConnection(rs);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
2 changes: 2 additions & 0 deletions src/lang/language.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1078,3 +1078,5 @@ CASE_MANAGEMENT_FINISH_TIME = Finish Time
CASE_MANAGEMENT_SEVERITY = Severity:
IMPORTCSV=Import csv

HIV_HISTORY=HIV_History
WOUND_HISTORY=Wound_History
1 change: 1 addition & 0 deletions src/lang/language_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1074,3 +1074,4 @@ CASE_MANAGEMENT_FINISH_TIME = Finish Time
CASE_MANAGEMENT_SEVERITY = Severity:
IMPORTCSV=Import csv

HIV_HISTORY=HIV_History

0 comments on commit fe77ce5

Please sign in to comment.