<%-- /* * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. * * This software is published under the GPL GNU General Public License. * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * * This software was written for the * Department of Family Medicine * McMaster Unviersity * Hamilton * Ontario, Canada */ --%> <%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="/WEB-INF/oscarProperties-tag.tld" prefix="oscarProp" %> <%@ page import="oscar.OscarProperties, oscar.oscarClinic.ClinicData, java.util.*" %> <% oscar.oscarEncounter.oscarConsultationRequest.pageUtil.EctConsultationFormRequestUtil reqFrm; reqFrm = new oscar.oscarEncounter.oscarConsultationRequest.pageUtil.EctConsultationFormRequestUtil (); reqFrm.estRequestFromId((String)request.getAttribute("reqId")); reqFrm.specPhone = request.getParameter("phone"); if (reqFrm.specPhone == null || reqFrm.specPhone.equals("null")){ reqFrm.specPhone = new String(); } reqFrm.specFax = request.getParameter("fax"); if (reqFrm.specFax == null || reqFrm.specFax.equals("null")){ reqFrm.specFax = new String(); } reqFrm.specAddr = request.getParameter("address"); if (reqFrm.specAddr == null || reqFrm.specAddr.equals("null")){ reqFrm.specAddr = new String(); } OscarProperties props = OscarProperties.getInstance(); ClinicData clinic = new ClinicData(); String strPhones = clinic.getClinicDelimPhone(); if (strPhones == null) { strPhones = ""; } String strFaxes = clinic.getClinicDelimFax(); if (strFaxes == null) { strFaxes = ""; } Vector vecPhones = new Vector(); Vector vecFaxes = new Vector(); StringTokenizer st = new StringTokenizer(strPhones,"|"); while (st.hasMoreTokens()) { vecPhones.add(st.nextToken()); } st = new StringTokenizer(strFaxes,"|"); while (st.hasMoreTokens()) { vecFaxes.add(st.nextToken()); } // for satellite clinics Vector vecAddressName = null; Vector vecAddress = null; Vector vecAddressPhone = null; Vector vecAddressFax = null; Vector vecAddressBillingNo = null; if(props.getProperty("clinicSatelliteName") != null) { vecAddressName = new Vector(); vecAddress = new Vector(); vecAddressPhone = new Vector(); vecAddressFax = new Vector(); vecAddressBillingNo = new Vector(); String[] temp0 = props.getProperty("clinicSatelliteName", "").split("\\|"); String[] temp1 = props.getProperty("clinicSatelliteAddress", "").split("\\|"); String[] temp2 = props.getProperty("clinicSatelliteCity", "").split("\\|"); String[] temp3 = props.getProperty("clinicSatelliteProvince", "").split("\\|"); String[] temp4 = props.getProperty("clinicSatellitePostal", "").split("\\|"); String[] temp5 = props.getProperty("clinicSatellitePhone", "").split("\\|"); String[] temp6 = props.getProperty("clinicSatelliteFax", "").split("\\|"); String[] temp7 = props.getProperty("clinicDocBillingNoList", "").split("\\|"); for(int i=0; i <bean:message key="oscarEncounter.oscarConsultationRequest.consultationFormPrint.title"/>
"/> "/> <% if(vecPhones.size() > 0) { %> <% } %> <% if(vecFaxes.size() > 0) { %> <% } %> <% if(vecAddress != null) { %> <% } %>
mail " onclick="javascript :flipFaxFooter();"/> " onclick="javascript: PrintWindow();"/> " /> " onclick="javascript: CloseWindow();"/> P F Address
> <% if(vecAddressBillingNo != null) {%> <% } %>
   <%-- blank column for spacing --%> <%=props.getProperty("faxLogo", "").equals("")?"":""%>    <%-- blank column for spacing --%> <%=clinic.getClinicName()%> <% for(int i=0; i <% } %>
<%=i" + vecAddressBillingNo.get(i)) : ""%> <%=(i+1)")+ vecAddressBillingNo.get(i+1): ""%> <%=(i+2)")+ vecAddressBillingNo.get(i+2): ""%>
Dr. Robert S. Coull
<%=clinic.getClinicAddress()%>
<%=clinic.getClinicCity()%>
<%=clinic.getClinicProvince()%> <%=clinic.getClinicPostal()%>
Tel: <%=vecPhones.size()>=1?vecPhones.elementAt(0):clinic.getClinicPhone()%> Fax: <%=vecFaxes.size()>=1?vecFaxes.elementAt(0):clinic.getClinicFax()%>
Tel: Fax:

Please inform us when appointment has been issued so we can update our records.
: <% if(reqFrm.pwb.equals("1")){ %> <%}else{ %> <%=reqFrm.referalDate%> <%}%>
: <%=reqFrm.getSpecailistsName(reqFrm.specialist) %>
: <%=reqFrm.specAddr%>
: <%=reqFrm.specPhone%>
: <%=reqFrm.specFax%>
: <% if (reqFrm.urgency.equals("1")) { %> <% }else if(reqFrm.urgency.equals("2")){ %> <% }else if (reqFrm.urgency.equals("3")){ %> <% } %>
: <%=reqFrm.getServiceName(reqFrm.service) %>
: <%=reqFrm.patientName %>
: <%=reqFrm.patientAddress %>
<%=reqFrm.patientPhone %>
<%=reqFrm.patientWPhone %>
: <%=reqFrm.patientDOB %> (y/m/d)
(<%=reqFrm.patientHealthCardType%>) <%=reqFrm.patientHealthNum %> <%=reqFrm.patientHealthCardVersionCode%> 
: <%if (Integer.parseInt(reqFrm.status) > 2 ){%> <%=reqFrm.appointmentYear %>/<%=reqFrm.appointmentMonth %>/<%=reqFrm.appointmentDay %> (y/m/d) <%}else{%>   <%}%>
: <%if (Integer.parseInt(reqFrm.status) > 2 ){%> <%=reqFrm.appointmentHour %>:<%=reqFrm.appointmentMinute %> <%=reqFrm.appointmentPm %> <%}else{%>   <%}%>
<%=reqFrm.patientChartNo%>
REASON FOR REFERRAL:
<%=reqFrm.reasonForConsultation %>  
PREVIOUS HISTORY:
<%=divy(reqFrm.concurrentProblems) %>  
CURRENT MEDICATIONS:
<%=divy(reqFrm.currentMedications) %>  
ALLERGIES:
<%=divy(reqFrm.allergies) %>  
 
<%=divy(reqFrm.clinicalInformation) %>  
Yours sincerely,
 
 
 
ROBBIE COULL
Family Physician
<%! public String divy (String str){ StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(str); int j =0; int i = 0 ; System.out.println("str "+str); while (i < stringBuffer.length() ){ if (stringBuffer.charAt(i) == '\n'){ stringBuffer.insert(i,"
"); System.out.println("i = "+stringBuffer.charAt(i)+" i-1 = "+stringBuffer.charAt(i-1)+" i+1 "+stringBuffer.charAt(i+4)); i = i + 4; } i++; } return stringBuffer.toString(); } public int getlen (String str){ if (str == null) return 0; return str.length(); } public String formatEmail(oscar.oscarEncounter.oscarConsultationRequest.pageUtil.EctConsultationFormRequestUtil reqFrm){ String Urgency = ""; if (reqFrm.urgency.equals("1")) { Urgency = "Urgent"; }else if(reqFrm.urgency.equals("2")){ Urgency = "Non-Urgent"; }else if (reqFrm.urgency.equals("3")){ Urgency = "Return"; } String s = ""; s +="Date:"+reqFrm.referalDate+"
"; s +="Status:"+Urgency+"
"; s +="Service:"+reqFrm.getServiceName(reqFrm.service)+"
"; s +="Specailist:"+reqFrm.getSpecailistsName(reqFrm.specialist) +" Phone:"+reqFrm.specPhone+" Fax: "+reqFrm.specFax+"
"; s +="Address: "+reqFrm.specAddr+"


"; s +="Patient Info
"; s +="Name:"+reqFrm.patientName+"
"; s +="DOB:"+reqFrm.patientDOB+"
"; s +="HIN:"+reqFrm.patientHealthNum+" "+reqFrm.patientHealthCardVersionCode+" HIN Type:"+reqFrm.patientHealthCardType+"
"; s +="Phone:"+reqFrm.patientPhone+"
"; s +="Phone:"+reqFrm.patientWPhone+"
"; s +="Address:"+reqFrm.patientAddress+"


"; s += "Reason For Consultation
"; s += divy(reqFrm.reasonForConsultation); s += "

"; s += "Pertinent Clinical Information
"; s += divy(reqFrm.clinicalInformation); s += "

"; s += "Significant Concurrent Problems
"; s += divy(reqFrm.concurrentProblems); s += "

"; s += "Current Medications
"; s += divy(reqFrm.currentMedications); s += "

"; s += "Allergies
"; s += divy(reqFrm.allergies); s += "

"; s += "Associated with: "+reqFrm.getProviderName(reqFrm.providerNo)+"
"; s += "Family Doctor: "+reqFrm.getFamilyDoctor() ; s = s.replaceAll("\"","""); return s; } %>