Update of /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarRx/data
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv331
Modified Files:
RxPrescriptionData.java
Log Message:
changed to handle 3 new fields
unit, method, route
Index: RxPrescriptionData.java
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarRx/data/RxPrescriptionData.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** RxPrescriptionData.java 2 Feb 2005 01:50:09 -0000 1.6
--- RxPrescriptionData.java 20 Apr 2005 20:30:17 -0000 1.7
***************
*** 31,34 ****
--- 31,35 ----
import java.util.*;
import java.sql.*;
+ import org.apache.commons.lang.*;
public class RxPrescriptionData {
***************
*** 65,68 ****
--- 66,72 ----
prescription.setAtcCode(rs.getString("ATC"));
prescription.setRegionalIdentifier(rs.getString("regional_Identifier"));
+ prescription.setUnit(rs.getString("unit"));
+ prescription.setMethod(rs.getString("method"));
+ prescription.setRoute(rs.getString("route"));
}
***************
*** 104,107 ****
--- 108,114 ----
prescription.setAtcCode(favorite.getAtcCode());
prescription.setRegionalIdentifier(favorite.getRegionalIdentifier());
+ prescription.setUnit(favorite.getUnit());
+ prescription.setMethod(favorite.getMethod());
+ prescription.setRoute(favorite.getRoute());
***************
*** 131,135 ****
prescription.setAtcCode(rePrescribe.getAtcCode());
prescription.setRegionalIdentifier(rePrescribe.getRegionalIdentifier());
!
return prescription;
}
--- 138,144 ----
prescription.setAtcCode(rePrescribe.getAtcCode());
prescription.setRegionalIdentifier(rePrescribe.getRegionalIdentifier());
! prescription.setUnit(rePrescribe.getUnit());
! prescription.setMethod(rePrescribe.getMethod());
! prescription.setRoute(rePrescribe.getRoute());
return prescription;
}
***************
*** 176,179 ****
--- 185,191 ----
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
+ p.setUnit(rs.getString("unit"));
+ p.setMethod(rs.getString("method"));
+ p.setRoute(rs.getString("route"));
lst.add(p);
}
***************
*** 229,233 ****
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
!
lst.add(p);
}
--- 241,247 ----
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
! p.setUnit(rs.getString("unit"));
! p.setMethod(rs.getString("method"));
! p.setRoute(rs.getString("route"));
lst.add(p);
}
***************
*** 245,248 ****
--- 259,278 ----
}
+
+ public Vector getCurrentATCCodesByPatient(int demographicNo) {
+ Vector vec = new Vector();
+ Prescription[] p = getPrescriptionsByPatientHideDeleted(demographicNo);
+ for( int i =0 ; i < p.length; i++){
+ if(p[i].isCurrent()){
+ System.out.println(p[i].getAtcCode()+" "+p[i].getBrandName());
+ if (!vec.contains(p[i].getAtcCode())){
+ System.out.println("Actually Adding "+p[i].getAtcCode()+" "+p[i].getBrandName());
+ vec.add(p[i].getAtcCode());
+ }
+ }
+ }
+ return vec;
+ }
+
///////////////////////
***************
*** 306,310 ****
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
!
lst.add(p);
}
--- 336,342 ----
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
! p.setUnit(rs.getString("unit"));
! p.setMethod(rs.getString("method"));
! p.setRoute(rs.getString("route"));
lst.add(p);
}
***************
*** 370,374 ****
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
!
lst.add(p);
}
--- 402,408 ----
p.setAtcCode(rs.getString("ATC"));
p.setRegionalIdentifier(rs.getString("regional_identifier"));
! p.setUnit(rs.getString("unit"));
! p.setMethod(rs.getString("method"));
! p.setRoute(rs.getString("route"));
lst.add(p);
}
***************
*** 406,410 ****
rs.getString("quantity"),
rs.getInt("repeat"), rs.getInt("nosubs"),
! rs.getInt("prn"), rs.getString("special"),rs.getString("GN"),rs.getString("ATC"),rs.getString("regional_identifier"));
--- 440,444 ----
rs.getString("quantity"),
rs.getInt("repeat"), rs.getInt("nosubs"),
! rs.getInt("prn"), rs.getString("special"),rs.getString("GN"),rs.getString("ATC"),rs.getString("regional_identifier"),rs.getString("unit"),rs.getString("method"),rs.getString("route"));
***************
*** 442,446 ****
rs.getString("quantity"),
rs.getInt("repeat"), rs.getInt("nosubs"),
! rs.getInt("prn"), rs.getString("special"),rs.getString("GN"),rs.getString("ATC"),rs.getString("regional_identifier"));
}
--- 476,480 ----
rs.getString("quantity"),
rs.getInt("repeat"), rs.getInt("nosubs"),
! rs.getInt("prn"), rs.getString("special"),rs.getString("GN"),rs.getString("ATC"),rs.getString("regional_identifier"),rs.getString("unit"),rs.getString("method"),rs.getString("route"));
}
***************
*** 475,479 ****
/** This function is used to save a set of prescribed drugs to as one
! * prescription. This is for historical perposes
* @param bean This is the oscarRx session bean
* @return This returns the insert id of the script to be included
--- 509,513 ----
/** This function is used to save a set of prescribed drugs to as one
! * prescription. This is for historical purposes
* @param bean This is the oscarRx session bean
* @return This returns the insert id of the script to be included
***************
*** 540,545 ****
System.out.println("date_prescribed " +date_prescribed+" date printed "+date_printed);
!
!
String sql = " insert into prescription "
--- 574,578 ----
System.out.println("date_prescribed " +date_prescribed+" date printed "+date_printed);
!
String sql = " insert into prescription "
***************
*** 550,554 ****
+" '"+date_prescribed+"', "
+" '"+date_printed+"', "
! +" '"+textView.toString()+"') ";
try{
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
--- 583,587 ----
+" '"+date_prescribed+"', "
+" '"+date_printed+"', "
! +" '"+StringEscapeUtils.escapeSql(textView.toString())+"') ";
try{
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
***************
*** 601,604 ****
--- 634,640 ----
String atcCode = null;
String regionalIdentifier = null;
+ String method = null;
+ String unit = null;
+ String route = null;
//RxDrugData.GCN gcn = null;
***************
*** 1119,1122 ****
--- 1155,1160 ----
b = true;
+
+
// if it doesn't already exist add it.
if(this.getDrugId() == 0) {
***************
*** 1125,1134 ****
+ "takemin, takemax, "
+ "freqcode, duration, durunit, quantity, "
! + "repeat, nosubs, prn, special,GN,script_no,ATC,regional_identifier) "
+ "VALUES ('" + this.getProviderNo() + "', " + this.getDemographicNo() + ", '"
+ RxUtil.DateToString(this.getRxDate()) + "', '"
+ RxUtil.DateToString(this.getEndDate()) + "', '"
! + this.getBrandName() + "', " + this.getGCN_SEQNO()
! + ", '" + this.getCustomName() + "', "
+ this.getTakeMin() + ", " + this.getTakeMax() + ", '"
+ this.getFrequencyCode() + "', '" + this.getDuration() + "', '"
--- 1163,1172 ----
+ "takemin, takemax, "
+ "freqcode, duration, durunit, quantity, "
! + "repeat, nosubs, prn, special,GN,script_no,ATC,regional_identifier,unit,method,route,create_date) "
+ "VALUES ('" + this.getProviderNo() + "', " + this.getDemographicNo() + ", '"
+ RxUtil.DateToString(this.getRxDate()) + "', '"
+ RxUtil.DateToString(this.getEndDate()) + "', '"
! + StringEscapeUtils.escapeSql(this.getBrandName()) + "', " + this.getGCN_SEQNO()
! + ", '" + StringEscapeUtils.escapeSql(this.getCustomName()) + "', "
+ this.getTakeMin() + ", " + this.getTakeMax() + ", '"
+ this.getFrequencyCode() + "', '" + this.getDuration() + "', '"
***************
*** 1137,1141 ****
+ this.getPrnInt() + ", '"
+ RxUtil.replace(this.getSpecial(), "'", "") + "','"+this.getGenericName()+"','"+scriptId+"', '"
! + this.getAtcCode() +"', '"+this.getRegionalIdentifier()+"')";
--- 1175,1179 ----
+ this.getPrnInt() + ", '"
+ RxUtil.replace(this.getSpecial(), "'", "") + "','"+this.getGenericName()+"','"+scriptId+"', '"
! + this.getAtcCode() +"', '"+this.getRegionalIdentifier()+"','"+this.getUnit()+"','"+this.getMethod()+"','"+this.getRoute()+"',now())";
***************
*** 1157,1162 ****
}
! } else // update the daterbase
! {
sql = "UPDATE drugs SET "
+ "provider_no = '" + this.getProviderNo() + "', "
--- 1195,1199 ----
}
! } else { // update the daterbase
sql = "UPDATE drugs SET "
+ "provider_no = '" + this.getProviderNo() + "', "
***************
*** 1178,1182 ****
+ "special = '" + RxUtil.replace(this.getSpecial(), "'", "") + "', "
+ "ATC = '" +this.atcCode+"', "
! + "regional_identifier = '"+this.regionalIdentifier+"' "
+ "WHERE drugid = " + this.getDrugId();
--- 1215,1222 ----
+ "special = '" + RxUtil.replace(this.getSpecial(), "'", "") + "', "
+ "ATC = '" +this.atcCode+"', "
! + "regional_identifier = '"+this.regionalIdentifier+"', "
! + "unit = '"+this.getUnit()+"', "
! + "method = '"+this.getMethod()+"', "
! + "route = '"+this.getRoute()+"' "
+ "WHERE drugid = " + this.getDrugId();
***************
*** 1206,1210 ****
this.getRepeat(), this.getNosubsInt(), this.getPrnInt(),
this.getSpecial(),this.getGenericName(),
! this.getAtcCode(),this.getRegionalIdentifier());
return fav.Save();
--- 1246,1250 ----
this.getRepeat(), this.getNosubsInt(), this.getPrnInt(),
this.getSpecial(),this.getGenericName(),
! this.getAtcCode(),this.getRegionalIdentifier(),this.getUnit(),this.getMethod(),this.getRoute());
return fav.Save();
***************
*** 1243,1246 ****
--- 1283,1334 ----
}
+ /**
+ * Getter for property method.
+ * @return Value of property method.
+ */
+ public java.lang.String getMethod() {
+ return method;
+ }
+
+ /**
+ * Setter for property method.
+ * @param method New value of property method.
+ */
+ public void setMethod(java.lang.String method) {
+ this.method = method;
+ }
+
+ /**
+ * Getter for property unit.
+ * @return Value of property unit.
+ */
+ public java.lang.String getUnit() {
+ return unit;
+ }
+
+ /**
+ * Setter for property unit.
+ * @param unit New value of property unit.
+ */
+ public void setUnit(java.lang.String unit) {
+ this.unit = unit;
+ }
+
+ /**
+ * Getter for property route.
+ * @return Value of property route.
+ */
+ public java.lang.String getRoute() {
+ return route;
+ }
+
+ /**
+ * Setter for property route.
+ * @param route New value of property route.
+ */
+ public void setRoute(java.lang.String route) {
+ this.route = route;
+ }
+
}
***************
*** 1265,1268 ****
--- 1353,1359 ----
String atcCode;
String regionalIdentifier;
+ String unit;
+ String method;
+ String route;
public Favorite(int favoriteId, String providerNo, String favoriteName,
***************
*** 1270,1274 ****
float takeMin, float takeMax, String frequencyCode, String duration,
String durationUnit, String quantity,
! int repeat, int nosubs, int prn, String special,String GN,String atc,String regionalIdentifier) {
this.favoriteId = favoriteId;
this.providerNo = providerNo;
--- 1361,1365 ----
float takeMin, float takeMax, String frequencyCode, String duration,
String durationUnit, String quantity,
! int repeat, int nosubs, int prn, String special,String GN,String atc,String regionalIdentifier,String unit,String method,String route) {
this.favoriteId = favoriteId;
this.providerNo = providerNo;
***************
*** 1290,1293 ****
--- 1381,1387 ----
this.atcCode = atc;
this.regionalIdentifier= regionalIdentifier;
+ this.unit = unit;
+ this.method = method;
+ this.route = route;
}
***************
*** 1491,1495 ****
+ "BN, GCN_SEQNO, customName, takemin, takemax, "
+ "freqcode, duration, durunit, quantity, "
! + "repeat, nosubs, prn, special,GN,ATC,regional_identifier) "
+ "VALUES ('" + this.getProviderNo() + "', '" + this.getFavoriteName() + "', '"
+ this.getBN() + "', " + this.getGCN_SEQNO() + ", '"
--- 1585,1589 ----
+ "BN, GCN_SEQNO, customName, takemin, takemax, "
+ "freqcode, duration, durunit, quantity, "
! + "repeat, nosubs, prn, special,GN,ATC,regional_identifier,unit,method,route) "
+ "VALUES ('" + this.getProviderNo() + "', '" + this.getFavoriteName() + "', '"
+ this.getBN() + "', " + this.getGCN_SEQNO() + ", '"
***************
*** 1503,1507 ****
+ this.getGN()+"', ' "
+ this.getAtcCode()+"', '"
! + this.getRegionalIdentifier()+"')";
db.RunSQL(sql);
--- 1597,1604 ----
+ this.getGN()+"', ' "
+ this.getAtcCode()+"', '"
! + this.getRegionalIdentifier()+"', '"
! + this.getUnit()+"', '"
! + this.getMethod()+"', '"
! + this.getRoute()+"')";
db.RunSQL(sql);
***************
*** 1539,1543 ****
+ "GN = '"+this.getGN()+"', '"
+ "ATC = '"+this.getAtcCode()+"', '"
! + "regional_identifier = '"+this.getRegionalIdentifier()+"' "
+ "WHERE favoriteid = " + this.getFavoriteId();
--- 1636,1643 ----
+ "GN = '"+this.getGN()+"', '"
+ "ATC = '"+this.getAtcCode()+"', '"
! + "regional_identifier = '"+this.getRegionalIdentifier()+"', '"
! + "unit = '"+this.getUnit()+"', '"
! + "method = '"+this.getMethod()+"', "
! + "route = '"+this.getRoute()+"' "
+ "WHERE favoriteid = " + this.getFavoriteId();
***************
*** 1589,1592 ****
--- 1689,1740 ----
}
+ /**
+ * Getter for property unit.
+ * @return Value of property unit.
+ */
+ public java.lang.String getUnit() {
+ return unit;
+ }
+
+ /**
+ * Setter for property unit.
+ * @param unit New value of property unit.
+ */
+ public void setUnit(java.lang.String unit) {
+ this.unit = unit;
+ }
+
+ /**
+ * Getter for property method.
+ * @return Value of property method.
+ */
+ public java.lang.String getMethod() {
+ return method;
+ }
+
+ /**
+ * Setter for property method.
+ * @param method New value of property method.
+ */
+ public void setMethod(java.lang.String method) {
+ this.method = method;
+ }
+
+ /**
+ * Getter for property route.
+ * @return Value of property route.
+ */
+ public java.lang.String getRoute() {
+ return route;
+ }
+
+ /**
+ * Setter for property route.
+ * @param route New value of property route.
+ */
+ public void setRoute(java.lang.String route) {
+ this.route = route;
+ }
+
}
}
|