Well you asked for it :)
-------------------------
test.jsp
-------------------------
<?xml version="1.0"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:session="http://apache.org/xsp/session/2.0"
xmlns:xsp-response="http://apache.org/xsp/response/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:util="http://apache.org/xsp/util/2.0">
<xsp:initialize/>
<xsp:structure>
<xsp:include>gov.cdc.nedss.systemservice.nbssecurity.*</xsp:include>
<xsp:include>cgh.*</xsp:include>
<xsp:include>java.sql.*</xsp:include>
<xsp:include>java.util.*</xsp:include>
<xsp:include>java.io.*</xsp:include>
<xsp:include>java.text.*</xsp:include>
<xsp:include>java.util.GregorianCalendar</xsp:include>
<xsp:include>java.util.HashMap</xsp:include>
</xsp:structure>
<content>
<xsp:logic><![CDATA[
int iPageInt = 0;
boolean boEdit = false;
String personUID = "";
String editModValue = "class=\"fieldRDNLY\" READONLY";
String urlParams = "";
if(request.getParameter("pageInt") != null){
iPageInt = new Integer(request.getParameter("pageInt")).intValue();
}
if(request.getParameter("uid") != null){
personUID = request.getParameter("uid").toString();
urlParams += "&uid="+personUID;
}
String sError = "";
String perUid = request.getParameter("uid");
boolean newSession = session.isNew();
cgh.openCon useCon = null;
Connection reuseCon = null;
Statement reuseState = null;
patientVO patVO = null;
patientVO patNameVO = null;
patientVO patRaceVO = null;
patientVO patPostVO = null;
patientVO patTeleVO = null;
materialVO patHistVO = null;
LinkedList patNameLL = null;
LinkedList patPostLL = null;
LinkedList patTeleLL = null;
LinkedList patHistLL = null;
ListIterator patNameItr = null;
ListIterator patPostItr = null;
ListIterator patTeleItr = null;
ListIterator patHistItr = null;
Schedule patSchedule = null;
SimpleDateFormat sdf = null;
CGHCalendar DOB = null;
cgh.connDB list = null;
gov.cdc.nedss.systemservice.nbssecurity.NBSSecurityObj nbsSecObj = null;
nbsSecObj =
(gov.cdc.nedss.systemservice.nbssecurity.NBSSecurityObj)session.getAttribute
("NBSSecurityObject");
Object NBSObjectStore = session.getAttribute("NBSObjectStore");
Common_Functions cf = new Common_Functions();
patNameVO = new patientVO();
patPostVO = new patientVO();
patTeleVO = new patientVO();
patHistVO = new materialVO();
patNameItr = null;
patPostItr = null;
patTeleItr = null;
patHistItr = null;
sdf = new SimpleDateFormat("MM/dd/yyyy");
try{
useCon = new cgh.openCon();
reuseCon = useCon.getConnection();
reuseState = useCon.getStatement(reuseCon);
patVO = new cgh.patientVO();
list = new cgh.connDB();
ListIterator customLinkedList = list.getPatientLinkedList(personUID,
reuseState).listIterator();
while (customLinkedList.hasPrevious())
patVO = (cgh.patientVO) customLinkedList.previous();
if (customLinkedList.hasNext())
patVO = (cgh.patientVO) customLinkedList.next();
session.setAttribute("patVO", patVO);
list = null;
list = new cgh.connDB();
patNameLL = list.getPatientNameList(personUID, reuseState);
session.setAttribute("patNameLL", patNameLL);
list = null;
patNameItr = patNameLL.listIterator();
while (patNameItr.hasPrevious())
patNameVO = (patientVO) patNameItr.previous();
patRaceVO = new patientVO();
list = new connDB();
customLinkedList = list.getPatientRaceList(personUID,
reuseState).listIterator();
while (customLinkedList.hasPrevious())
patRaceVO = (patientVO) customLinkedList.previous();
if (customLinkedList.hasNext())
patRaceVO = (patientVO) customLinkedList.next();
session.setAttribute("patRaceVO", patRaceVO);
list = null;
list = new connDB();
customLinkedList = list.getPatientPostalList(personUID,
reuseState).listIterator();
patPostItr = customLinkedList;
while (patPostItr.hasPrevious())
patPostVO = (patientVO) patPostItr.previous();
session.setAttribute("patPostItr", patPostItr);
list = null;
list = new connDB();
patTeleLL = list.getPatientTelephoneList(personUID, reuseState);
session.setAttribute("patTeleLL", patTeleLL);
list = null;
patTeleItr = patTeleLL.listIterator();
while (patTeleItr.hasPrevious())
patTeleVO = (patientVO) patTeleItr.previous();
list = new connDB();
patHistLL =
list.getPatientHistoryList(((patientVO)session.getAttribute("patVO")).getloc
al_id(), reuseState);
session.setAttribute("patHistLL", patHistLL);
list = null;
patHistItr = patHistLL.listIterator();
session.setAttribute("patHistItr", patHistItr);
session.setAttribute("patHistVO", patHistVO);
StreamParser stpr = new StreamParser();
VacParser vp = new VacParser(); // utill for the xml schedule
stpr.parse(stpr.getInputStream()); // parse in the current schedule
Schedule sched = stpr.getSchedule(); // return the default 'blank'
schedule
java.util.Date setToDob = new java.util.Date(patVO.getbirth_time());
sched.setDOB(new CGHCalendar(new java.util.Date(patVO.getbirth_time()))); //
build the schedule based on the birth date
if (patHistItr != null){
while (patHistItr.hasPrevious()) patHistItr.previous();
while(patHistItr.hasNext()){
patHistVO = (materialVO) patHistItr.next();
sched.addHistoricalDose(
Common_Functions.isSeries(patHistVO.getcd_desc_txt()),
new CGHCalendar(new java.util.Date(patHistVO.getfrom_time())),
false,
true);
}
}
session.setAttribute("patSchedule", sched);
patSchedule = (Schedule) session.getAttribute("patSchedule");
stpr = null;
if (newSession){
reuseState = null;
useCon.closeConnection(reuseCon);
useCon = null;
}
DOB = new CGHCalendar(new java.util.Date(patVO.getbirth_time()));
}catch(java.lang.NullPointerException npe){
// Error Thrown
}catch(java.lang.Exception e){
// Error Thrown
}
]]></xsp:logic>
<link-bar>
<xsp:attribute name="authorized">
<xsp-request:get-attribute name="filePermission"/>
</xsp:attribute>
<link name="Go Google.com">http://www.google.com</link>
</link-bar>
<button-bar>
<left>
<label>Manage Patient</label>
<javascript-action>getPage('PatientSearchResults1.do?ContextAction=ViewFile&
amp;uid=<xsp:expr>perUid</xsp:expr>');</javascript-action>
</left>
<left>
<label>Manage Vaccines</label>
<javascript-action>getPage('PatientSearchResults1.do?ContextAction=ViewFile&
amp;uid=<xsp:expr>perUid</xsp:expr>#Vaccinations');</javascript-action>
</left>
<right>
<label>Close</label>
<javascript-action>window.close();</javascript-action>
</right>
</button-bar>
<tab name="Patient Info">
<group name="Patient Information">
<line>
<free/>
<element type="raw">
<span>
<B>The name displayed here is a legal name and the address is a home
address.
<BR />
To view additional information, click the Manage Patient button above.</B>
<BR /><BR />
<TABLE id="Table8" cellSpacing="0" cellPadding="2" width="620" border="0">
<TR rowID="2">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Last Name: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""><xsp:expr>patVO.getlast_nm()</xsp:expr></SPAN></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">First Name: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""><xsp:expr>patVO.getfirst_nm()</xsp:expr></SPAN></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Middle Name: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN
id=""><xsp:expr>patVO.getmiddle_nm()</xsp:expr></SPAN></NOBR></TD>
</TR>
<TR rowID="3">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">DOB: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""><xsp:expr>DOB</xsp:expr></SPAN></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Current Age: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""></SPAN>~Collect~<SPAN id="" type="select" value=""></SPAN><INPUT
id="Hidden1" type="hidden"
value="D$Days|H$Hours|N$Minutes|M$Months|UNK$Unknown|W$Weeks|Y$Years|"
name="Hidden1" /></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Age Reported Date: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN
id="">~Collect~</SPAN></NOBR></TD>
</TR>
<TR rowID="4">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Current Sex: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN id="" type="select"
value="M"><xsp:expr>patVO.getcurr_sex_cd()</xsp:expr></SPAN><INPUT
id="Hidden2" type="hidden" value="F$Female|M$Male|U$Unknown|" name="Hidden2"
/></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">SSN: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN
id=""><xsp:expr>patVO.getSSN()</xsp:expr></SPAN></NOBR></TD>
</TR>
<TR rowID="5">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Is the person deceased?</FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN id=""
type="select"
value="N"><xsp:expr>patVO.getdeceased_ind_cd()</xsp:expr></SPAN><INPUT
id="Hidden3" type="hidden" value="M$Missing data/ Unable to
determine|N$No|Y$Yes|" name="Hidden3" /></NOBR></TD>
</TR>
<xsp:logic>
if (patPostItr.hasNext()){
patPostVO = (patientVO) patPostItr.next();
String testThisSucker = "IT WORKED!";
}
</xsp:logic>
<TR rowID="6">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Address: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN
id=""><xsp:expr>patPostVO.getstreet_addr1()</xsp:expr></SPAN></NOBR></TD>
</TR>
<TR rowID="7">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack"></FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN
id=""></SPAN></NOBR></TD>
</TR>
<TR rowID="8">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">City: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""><xsp:expr>patPostVO.getcity_desc_txt()</xsp:expr></SPAN></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">State: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN id=""
type="select"
value=""><xsp:expr>patPostVO.getstate_cd()<xsp:expr></SPAN><INPUT
id="Hidden4" type="hidden" value="01$Alabama|02$Alaska|60$American
Samoa|04$Arizona|05$Arkansas|06$California|08$Colorado|09$Connecticut|10$Del
aware|11$District of Columbia|64$Federated States of
Micro|12$Florida|13$Georgia|66$Guam|15$Hawaii|16$Idaho|17$Illinois|18$Indian
a|19$Iowa|20$Kansas|21$Kentucky|22$Louisiana|23$Maine|68$Marshall
Islands|24$Maryland|25$Massachusetts|26$Michigan|27$Minnesota|28$Mississippi
|29$Missouri|30$Montana|31$Nebraska|32$Nevada|33$New Hampshire|34$New
Jersey|35$New Mexico|36$New York|37$North Carolina|38$North
Dakota|69$Northern Mariana
Islands|39$Ohio|40$Oklahoma|41$Oregon|70$Palau|42$Pennsylvania|72$Puerto
Rico|44$Rhode Island|45$South Carolina|46$South
Dakota|47$Tennessee|48$Texas|78$US Virgin
Islands|49$Utah|50$Vermont|51$Virginia|53$Washington|54$West
Virginia|55$Wisconsin|56$Wyoming|" name="Hidden4" /></NOBR></TD>
</TR>
<TR rowID="9">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">ZIP: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""><xsp:expr>patPostVO.getpostal_locator_uid()</xsp:expr></SPAN></NOBR></
TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">County: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN id=""
type="select" value=""></SPAN><INPUT id="Hidden5" type="hidden"
value="$|45001$Abbeville County|45003$Aiken County|45005$Allendale
County|45007$Anderson County|45009$Bamberg County|45011$Barnwell
County|45013$Beaufort County|45015$Berkeley County|45017$Calhoun
County|45019$Charleston County|45021$Cherokee County|45023$Chester
County|45025$Chesterfield County|45027$Clarendon County|45029$Colleton
County|45031$Darlington County|45033$Dillon County|45035$Dorchester
County|45037$Edgefield County|45039$Fairfield County|45041$Florence
County|45043$Georgetown County|45045$Greenville County|45047$Greenwood
County|45049$Hampton County|45051$Horry County|45053$Jasper
County|45055$Kershaw County|45057$Lancaster County|45059$Laurens
County|45061$Lee County|45063$Lexington County|45065$McCormick
County|45067$Marion County|45069$Marlboro County|45071$Newberry
County|45073$Oconee County|45075$Orangeburg County|45077$Pickens
County|45079$Richland County|45081$Saluda County|45083$Spartanburg
County|45085$Sumter County|45087$Union County|45089$Williamsburg
County|45091$York County|" name="Hidden5"
/><xsp:expr>patPostVO.getcnty_desc_txt()</xsp:expr></NOBR></TD>
</TR>
<xsp:logic>
if (patTeleItr.hasNext()){
patTeleVO = (patientVO) patTeleItr.next();
}
</xsp:logic>
<TR rowID="10">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Phone: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%"><NOBR><SPAN
id=""><xsp:expr>patTeleVO.getphone_nbr_txt()</xsp:expr></SPAN></NOBR></TD>
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Ext.: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN
id=""><xsp:expr>patTeleVO.getextension_txt()</xsp:expr></SPAN></NOBR></TD>
</TR>
<TR rowID="11">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Ethnicity: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="5"><NOBR><SPAN id=""
type="select" value="2135-2">
<xsp:logic>
String ethnic_group_ind = "";
if (patVO.getethnic_group_ind().equals("2135-2")){
ethnic_group_ind = "Hispanic or Latino";
}
else if (patVO.getethnic_group_ind().equals("2186-5")){
ethnic_group_ind = "Not Hispanic or Latino";
}
</xsp:logic>
<xsp:expr>ethnic_group_ind</xsp:expr>
</SPAN><INPUT id="list" type="hidden" value="2135-2$Hispanic or
Latino|2186-5$Not Hispanic or Latino|" name="list" /></NOBR></TD>
</TR>
<TR rowID="12">
<TD vAlign="middle" align="right" width="20%"><NOBR><FONT
class="boldTenBlack">Race: </FONT></NOBR></TD>
<TD vAlign="top" align="left" width="20%" colSpan="1"><SPAN id="">
<xsp:expr>cf.getRace(patRaceVO.getrace_cd(),
patRaceVO.getrace_category_cd())</xsp:expr>
</SPAN></TD>
<TD align="right" colspan="3"><strong>VAFAC Eligible: </strong></TD>
<TD>~Collect~</TD>
</TR>
</TABLE>
</span>
</element>
</line>
</group>
<group name="Schedule">
<line>
<free/>
<element type="raw">
<span>
<b>
<br />
CONTENT AREA FOR SCHEDULE
</b>
</span>
</element>
</line>
</group>
</tab>
<tab name="Forcasting">
<group name="Forcast">
<line>
<free/>
<element type="raw">
<span>
<TABLE id="Table10" borderColor="#000000" cellspacing="0" cellPadding="5"
width="610" align="center" bgColor="silver" border="0">
<TR class="SHADED">
<TD><STRONG><U>Recommendation</U></STRONG></TD>
<TD><STRONG><U>Series</U></STRONG></TD>
<TD><STRONG><U>Dose</U></STRONG></TD>
<TD><STRONG><U>From Date</U></STRONG></TD>
<TD><STRONG><U>To Date</U></STRONG></TD>
<TD width="45"><strong><u>Administer</u></strong></TD>
</TR>
<!-- xsp:logic>
try {
ListIterator patForecast = new LinkedList((((Schedule)
session.getAttribute("patSchedule")).getForecast()).values()).listIterator(0
);
Iterator patForecastKeys =
(patSchedule.getForecast()).keySet().iterator();
//out.println(((patSchedule.getForecast()).keySet()).toString());
//out.println(patSchedule.getForecast().values().toString()+"<BR>");
Dose curDose = null;
Dose preDose = null;
while (patForecast.hasNext()){
curDose = (Dose)patForecast.next();
if (patForecast.hasPrevious()) preDose =
(Dose)patForecast.previous();
out.println("<tr class=NOTSHADED>");
out.println("<td></td>");
out.println("<td>"+ patForecastKeys.next() +"</td>");
out.println("<td>"+ curDose.getSequenceNumber() +"</td>");
out.println("<td>"+ curDose.getMinAdministrationDate(DOB,
preDose)+"</td>");
out.println("<td>"+ curDose.getMaxAdministrationDate(DOB,
preDose)+"</td>");
out.println("<td></td>");
out.println("</tr>");
}
} catch (Exception e) {
e.printStackTrace();
}
</xsp:logic-->
<tr><td colspan="6"> xsp:expr UnLoad Forcast HERE /xsp:expr</td></tr>
</TABLE>
</span>
</element>
</line>
</group>
</tab>
<tab name="History">
<group name="History">
<line>
<free/>
<element type="raw">
<span>
<!--xsp:logic>
if (patHistItr.hasPrevious())
patHistItr = patHistLL.listIterator();
</xsp:logic-->
<TABLE class="TableInner" id="Table5" cellSpacing="0" cellPadding="5"
width="615" border="0">
<TBODY class="nestedElementsTypeFootHeader">
<TR class="Shaded">
<TD class="boldTenBlack"><A class="SortColumnHeader"
href="">Date Administered</A></TD>
<TD class="boldTenBlack"><A class="SortColumnHeader"
href="">Vaccine Administered</A></TD>
<TD class="boldTenBlack"><A class="SortColumnHeader"
href="">Dose</A></TD>
</TR>
<!-- xsp:logic>
ListIterator patHistory = new
LinkedList((patSchedule.getHistory()).values()).listIterator(0);
Iterator patHistoryKeys =
(patSchedule.getHistory()).keySet().iterator();
Dose curDose = null;
Iterator curSeriItr = null;
String seriesId = "";
while(patHistory.hasPrevious()) patHistory.previous();
while (patHistory.hasNext()){
curSeriItr = ((SortedSet) patHistory.next()).iterator();
seriesId = patHistoryKeys.next().toString();
while(curSeriItr.hasNext()){
curDose = (Dose)curSeriItr.next();
out.print("<tr class=NOTSHADED>");
out.print("<td>"+ curDose.getAdministrationDate()
+"</td>");
out.print("<td>"+ seriesId +"</td>");
if (!curDose.isDoseCounted())
out.print("<td>"+ curDose.getSequenceNumber()
+"</td>");
else
out.print("<td>Not Counted</td>");
out.print("</tr>");
}
}
</xsp:logic -->
<tr><td colspan="3"> xsp:expr UnLoad History HERE
/xsp:expr</td></tr>
</TBODY>
</TABLE>
</span>
</element>
</line>
</group>
</tab>
<tab name="Manage Forms">
<group name="South Carolina Certificate of Immunization">
<line>
<free/>
<element type="raw">
<span>
<b>CONTENT AREA FOR Manage Forms</b><br />
The Passed USER ID is : <xsp:expr>perUid</xsp:expr>
</span>
</element>
</line>
</group>
<group name="1103">
<line>
<free/>
<element type="raw">
<span>
<b>CONTENT AREA FOR Manage Forms</b><br />
The Passed USER ID is : <xsp:expr>perUid</xsp:expr>
</span>
</element>
</line>
</group>
</tab>
</content>
</xsp:page>
-------------------------
###
-------------------------
-----Original Message-----
From: Rob Gregory [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 3:12 PM
To: [EMAIL PROTECTED]
Subject: RE: logic question...
Is this a JSP or an XSP?? Can you post the complete page so we can help
further...
Regards Rob
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]