List of usage examples for com.lowagie.text Font UNDERLINE
int UNDERLINE
To view the source code for com.lowagie.text Font UNDERLINE.
Click Source Link
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printAllergies(List<Allergy> allergies) throws DocumentException { ProviderDao providerDao = (ProviderDao) SpringUtils.getBean("providerDao"); /*/*from w ww. ja v a 2 s . com*/ if( getNewPage() ) getDocument().newPage(); else setNewPage(true); */ Font obsfont = new Font(getBaseFont(), FONTSIZE, Font.UNDERLINE); Paragraph p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_LEFT); Phrase phrase = new Phrase(LEADING, "\n", getFont()); p.add(phrase); phrase = new Phrase(LEADING, "Allergies", obsfont); p.add(phrase); getDocument().add(p); for (Allergy allergy : allergies) { p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk(allergy.getDescription()); phrase.add(chunk); p.add(phrase); getDocument().add(p); } getDocument().add(new Phrase("\n", getFont())); }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printRx(String demoNo, List<CaseManagementNote> cpp) throws DocumentException { if (demoNo == null) return;//from w w w.ja va2 s .c o m /* if( newPage ) document.newPage(); else newPage = true; */ oscar.oscarRx.data.RxPrescriptionData prescriptData = new oscar.oscarRx.data.RxPrescriptionData(); oscar.oscarRx.data.RxPrescriptionData.Prescription[] arr = {}; arr = prescriptData.getUniquePrescriptionsByPatient(Integer.parseInt(demoNo)); if (arr.length == 0) { return; } Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Prescriptions"); p.add(phrase); document.add(p); Font normal = new Font(bf, FONTSIZE, Font.NORMAL); Font curFont; for (int idx = 0; idx < arr.length; ++idx) { oscar.oscarRx.data.RxPrescriptionData.Prescription drug = arr[idx]; p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_LEFT); if (drug.isCurrent() && !drug.isArchived()) { curFont = normal; phrase = new Phrase(LEADING, "", curFont); phrase.add(formatter.format(drug.getRxDate()) + " - "); phrase.add(drug.getFullOutLine().replaceAll(";", " ")); p.add(phrase); document.add(p); } } }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printPreventions() throws DocumentException { List<Prevention> preventions = preventionDao.findNotDeletedByDemographicId(demographic.getDemographicNo()); if (preventions.size() == 0) { return;/*from w w w. j a va 2 s . com*/ } Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Preventions"); p.add(phrase); document.add(p); for (Prevention prevention : preventions) { String type = prevention.getPreventionType(); Date date = prevention.getPreventionDate(); p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk(type + " " + formatter.format(date) + "\n"); phrase.add(chunk); p.add(phrase); getDocument().add(p); } }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printTicklers() throws DocumentException { TicklerDAO ticklerDao = (TicklerDAO) SpringUtils.getBean("ticklerDAOT"); CustomFilter filter = new CustomFilter(); filter.setDemographic_no(String.valueOf(demographic.getDemographicNo())); List<Tickler> ticklers = ticklerDao.getTicklers(filter); if (ticklers.size() == 0) { return;//w ww . ja v a2s. c o m } Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Ticklers"); p.add(phrase); document.add(p); for (Tickler tickler : ticklers) { String providerName = tickler.getProvider().getFormattedName(); String assigneeName = tickler.getAssignee().getFormattedName(); String serviceDate = tickler.getServiceDate(); String priority = tickler.getPriority(); char status = tickler.getStatus(); String message = tickler.getMessage(); p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk("Provider:" + providerName + "\n"); phrase.add(chunk); chunk = new Chunk("Assignee:" + assigneeName + "\n"); phrase.add(chunk); chunk = new Chunk("Service Date:" + serviceDate + "\n"); phrase.add(chunk); chunk = new Chunk("Priority:" + priority + "\n"); phrase.add(chunk); chunk = new Chunk("Status:" + status + "\n"); phrase.add(chunk); chunk = new Chunk("Message:" + message + "\n\n"); phrase.add(chunk); p.add(phrase); getDocument().add(p); } }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printDiseaseRegistry() throws DocumentException { DxresearchDAO dxDao = (DxresearchDAO) SpringUtils.getBean("DxresearchDAO"); IssueDAO issueDao = (IssueDAO) SpringUtils.getBean("IssueDAO"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); List<Dxresearch> dxs = dxDao.getDxResearchItemsByPatient(demographic.getDemographicNo()); if (dxs.size() == 0) { return;//from ww w. j ava 2 s . co m } Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Disease Registry"); p.add(phrase); document.add(p); for (Dxresearch dx : dxs) { String codingSystem = dx.getCodingSystem(); String code = dx.getDxresearchCode(); Date startDate = dx.getStartDate(); char status = dx.getStatus(); Issue issue = issueDao.findIssueByTypeAndCode(codingSystem, code); p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk("Start Date:" + formatter.format(startDate) + "\n"); phrase.add(chunk); if (issue != null) { chunk = new Chunk("Issue:" + issue.getDescription() + "\n"); phrase.add(chunk); } else { chunk = new Chunk("Issue: <Unknown>" + "\n"); phrase.add(chunk); } chunk = new Chunk("Status:" + status + "\n\n"); phrase.add(chunk); p.add(phrase); getDocument().add(p); } }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printCurrentAdmissions() throws DocumentException { AdmissionDao admissionDao = (AdmissionDao) SpringUtils.getBean("admissionDao"); ProgramDao programDao = (ProgramDao) SpringUtils.getBean("programDao"); List<Admission> admissions = admissionDao.getCurrentAdmissions(demographic.getDemographicNo()); if (admissions.size() == 0) { return;// w ww . j av a2 s .co m } Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Current Admissions"); p.add(phrase); document.add(p); for (Admission admission : admissions) { String admissionDate = admission.getAdmissionDate("yyyy-MM-dd"); String admissionNotes = admission.getAdmissionNotes(); String programName = programDao.getProgramName(admission.getProgramId()); String programType = admission.getProgramType(); String providerName = providerDao.getProvider(admission.getProviderNo()).getFormattedName(); p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk("Summary:" + programName + "(" + programType + ")" + " by " + providerName + " on " + admissionDate + "\n"); phrase.add(chunk); chunk = new Chunk("Admission Notes:" + admissionNotes + "\n\n"); phrase.add(chunk); p.add(phrase); getDocument().add(p); } }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printPastAdmissions() throws DocumentException { AdmissionDao admissionDao = (AdmissionDao) SpringUtils.getBean("admissionDao"); ProgramDao programDao = (ProgramDao) SpringUtils.getBean("programDao"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); List<Admission> admissions = admissionDao.getAdmissions(demographic.getDemographicNo()); admissions = filterOutCurrentAdmissions(admissions); if (admissions.size() == 0) { return;/*from w ww. jav a2 s . co m*/ } Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Past Admissions"); p.add(phrase); document.add(p); for (Admission admission : admissions) { String admissionDate = admission.getAdmissionDate("yyyy-MM-dd"); String admissionNotes = admission.getAdmissionNotes(); String programName = programDao.getProgramName(admission.getProgramId()); String programType = admission.getProgramType(); String providerName = providerDao.getProvider(admission.getProviderNo()).getFormattedName(); String dischargeDate = formatter.format(admission.getDischargeDate()); String dischargeNotes = admission.getDischargeNotes(); p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk("Summary:" + programName + "(" + programType + ")" + " by " + providerName + " on " + admissionDate + "\n"); phrase.add(chunk); chunk = new Chunk("Admission Notes:" + admissionNotes + "\n\n"); phrase.add(chunk); chunk = new Chunk("Discharged on " + dischargeDate + ", Notes:" + dischargeNotes + "\n\n"); phrase.add(chunk); p.add(phrase); getDocument().add(p); } }
From source file:org.oscarehr.casemgmt.print.OscarChartPrinter.java
License:Open Source License
public void printCurrentIssues() throws DocumentException { CaseManagementIssueDAO cmIssueDao = (CaseManagementIssueDAO) SpringUtils.getBean("CaseManagementIssueDAO"); List<CaseManagementIssue> issues = cmIssueDao .getIssuesByDemographic(String.valueOf(demographic.getDemographicNo())); Paragraph p = new Paragraph(); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Phrase phrase = new Phrase(LEADING, "", obsfont); p.setAlignment(Paragraph.ALIGN_LEFT); phrase.add("Current Issues"); p.add(phrase);//from w ww . j a va 2 s . co m document.add(p); for (CaseManagementIssue issue : issues) { String type = issue.getType(); String description = issue.getIssue().getDescription(); p = new Paragraph(); phrase = new Phrase(LEADING, "", getFont()); Chunk chunk = new Chunk(description + "\n\n"); phrase.add(chunk); p.add(phrase); getDocument().add(p); } }
From source file:org.oscarehr.casemgmt.service.CaseManagementPrintPdf.java
License:Open Source License
public void printPersonalInfo() throws DocumentException { if (demoDtl != null && demoDtl.get("DEMO_ID") != null) { String demoId = demoDtl.get("DEMO_ID").toString(); DemographicDao demographicDao = (DemographicDao) SpringUtils.getBean("demographicDao"); Demographic demographic = demographicDao.getDemographic(demoId); if (demographic != null) { ResourceBundle propResource = ResourceBundle.getBundle("oscarResources"); List<String> demoFields = new ArrayList<String>(); //demographic section demoFields.add("##DEMOGRAPHIC"); String name = "Name: " + demographic.getLastName() + ", " + demographic.getFirstName(); demoFields.add(name);// ww w.ja v a 2 s. c o m String gender = "Gender: " + demographic.getSex(); demoFields.add(gender); String dob = propResource.getString("oscarEncounter.pdfPrint.dob") + " " + demoDtl.get("demoDOB"); if (dob != null && dob.trim().length() > 0) demoFields.add(dob); String age = propResource.getString("oscarEncounter.pdfPrint.age") + " " + demographic.getAge(); demoFields.add(age); String language = propResource.getString("oscarEncounter.pdfPrint.language") + " " + demographic.getOfficialLanguage(); demoFields.add(language); DemographicCustDao demographicCustDao = (DemographicCustDao) SpringUtils .getBean("demographicCustDao"); DemographicCust demographicCust = demographicCustDao.find(Integer.parseInt(demoId)); //other contacts demoFields.add("##OTHER CONTACTS"); DemographicRelationship demoRelation = new DemographicRelationship(); ArrayList<Hashtable<String, Object>> relList = demoRelation .getDemographicRelationshipsWithNamePhone(demographic.getDemographicNo().toString()); for (int reCounter = 0; reCounter < relList.size(); reCounter++) { Hashtable<String, Object> relHash = (Hashtable<String, Object>) relList.get(reCounter); String sdb = relHash.get("subDecisionMaker") == null ? "" : ((Boolean) relHash.get("subDecisionMaker")).booleanValue() ? "/SDM" : ""; String ec = relHash.get("emergencyContact") == null ? "" : ((Boolean) relHash.get("emergencyContact")).booleanValue() ? "/EC" : ""; String relation = relHash.get("relation") + sdb + ec + ": " + relHash.get("lastName") + ", " + relHash.get("firstName") + ", " + relHash.get("phone"); demoFields.add(relation); } //Contact Information demoFields.add("##CONTACT INFORMATION"); DemographicExtDao demographicExtDao = SpringUtils.getBean(DemographicExtDao.class); Map<String, String> demoExt = demographicExtDao.getAllValuesForDemo(demoId); String phone = ""; if (demographic.getPhone() != null && demographic.getPhone().trim().length() > 0) phone = demographic.getPhone() + " " + (demoExt.get("hPhoneExt") != null ? demoExt.get("hPhoneExt") : ""); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.phoneh") + " " + phone); String phoneW = ""; if (demographic.getPhone2() != null && demographic.getPhone2().trim().length() > 0) phoneW = demographic.getPhone2() + " " + demoExt.get("wPhoneExt") != null ? demoExt.get("wPhoneExt") : ""; demoFields.add(propResource.getString("oscarEncounter.pdfPrint.phonew") + " " + phoneW); String cellPhone = ""; if (demoExt.get("demo_cell") != null && demoExt.get("demo_cell").trim().length() > 0) cellPhone = demoExt.get("demo_cell").trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.cellphone") + " " + cellPhone); String address = ""; if (demographic.getAddress() != null && demographic.getAddress().trim().length() > 0) address = demographic.getAddress().trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.address") + " " + address); String city = ""; if (demographic.getCity() != null && demographic.getCity().trim().length() > 0) city = demographic.getCity().trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.city") + " " + city); String province = ""; if (demographic.getProvince() != null && demographic.getProvince().trim().length() > 0) province = demographic.getProvince().trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.province") + " " + province); String postal = ""; if (demographic.getPostal() != null && demographic.getPostal().trim().length() > 0) postal = demographic.getPostal().trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.postal") + " " + postal); String email = ""; if (demographic.getEmail() != null && demographic.getEmail().trim().length() > 0) email = demographic.getEmail().trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.email") + " " + email); String newsletter = ""; if (demographic.getNewsletter() != null && demographic.getNewsletter().trim().length() > 0) newsletter = demographic.getNewsletter().trim(); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.newsletter") + " " + newsletter); //health insurance demoFields.add("##HEALTH INSURANCE"); String hin = demographic.getHin() != null ? demographic.getHin() : ""; demoFields.add(propResource.getString("oscarEncounter.pdfPrint.health_ins") + " " + hin); String hcType = demographic.getHcType() != null ? demographic.getHcType() : ""; demoFields.add(propResource.getString("oscarEncounter.pdfPrint.hc_type") + " " + hcType); String EFFData = demographic.getEffDate() != null ? demographic.getEffDate().toString() : ""; demoFields.add(propResource.getString("oscarEncounter.pdfPrint.eff_date") + " " + EFFData); //clinic status demoFields.add("##CLINIC STATUS"); String dateJoined = demographic.getDateJoined() != null ? demographic.getDateJoined().toString() : ""; demoFields.add(propResource.getString("oscarEncounter.pdfPrint.date_joined") + " " + dateJoined); //Patient Clinic Status demoFields.add("##PATIENT CLINIC STATUS"); String doctorName = ""; ProviderDao providerDao = SpringUtils.getBean(ProviderDao.class); if (demographic.getProviderNo() != null && demographic.getProviderNo().trim().length() > 0) { doctorName = providerDao.getProviderName(demographic.getProviderNo()); } demoFields.add(propResource.getString("oscarEncounter.pdfPrint.doctor") + " " + doctorName); String nurseName = ""; if (demographicCust.getResident() != null && demographicCust.getResident().trim().length() > 0) { nurseName = providerDao.getProviderName(demographicCust.getResident()); } demoFields.add(propResource.getString("oscarEncounter.pdfPrint.nurse") + " " + nurseName); String midwifeName = ""; if (demographicCust.getMidwife() != null && demographicCust.getMidwife().trim().length() > 0) { midwifeName = providerDao.getProviderName(demographicCust.getMidwife()); } demoFields.add(propResource.getString("oscarEncounter.pdfPrint.midwife") + " " + midwifeName); String residentName = ""; if (demographicCust.getNurse() != null && demographicCust.getNurse().trim().length() > 0) { residentName = providerDao.getProviderName(demographicCust.getNurse()); } demoFields.add(propResource.getString("oscarEncounter.pdfPrint.resident") + " " + residentName); String rd = ""; String rdohip = ""; String fd = demographic.getFamilyDoctor(); if (fd != null) { rd = SxmlMisc.getXmlContent(StringUtils.trimToEmpty(demographic.getFamilyDoctor()), "rd"); rd = rd != null ? rd : ""; rdohip = SxmlMisc.getXmlContent(StringUtils.trimToEmpty(demographic.getFamilyDoctor()), "rdohip"); rdohip = rdohip != null ? rdohip : ""; } demoFields.add(propResource.getString("oscarEncounter.pdfPrint.referral_doctor") + " " + rd); demoFields.add(propResource.getString("oscarEncounter.pdfPrint.referral_doctor_no") + " " + rdohip); //RX INTERACTION WARNING LEVEL demoFields.add("##"); String warningLevel = demoExt.get("rxInteractionWarningLevel"); if (warningLevel == null) warningLevel = "0"; String warningLevelStr = "Not Specified"; if (warningLevel.equals("1")) { warningLevelStr = "Low"; } if (warningLevel.equals("2")) { warningLevelStr = "Medium"; } if (warningLevel.equals("3")) { warningLevelStr = "High"; } if (warningLevel.equals("4")) { warningLevelStr = "None"; } demoFields.add(propResource.getString("oscarEncounter.pdfPrint.rx_int_warning_level") + " " + warningLevelStr); String alert = demographicCust.getAlert() != null ? demographicCust.getAlert() : " "; demoFields.add(propResource.getString("oscarEncounter.pdfPrint.alert") + " " + alert); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Paragraph p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_CENTER); Phrase phrase = new Phrase(LEADING, "\n\n", font); p.add(phrase); phrase = new Phrase(LEADING, "Personal Information", obsfont); p.add(phrase); document.add(p); Font normal = new Font(bf, FONTSIZE, Font.NORMAL); Font obsfont2 = new Font(bf, 9, Font.UNDERLINE); int index = 0; int size = demoFields.size(); for (String personalInfoField : demoFields) { p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_LEFT); if (personalInfoField.startsWith("##")) { phrase = new Phrase(LEADING, "", obsfont2); personalInfoField = personalInfoField.replaceFirst("##", "").trim(); } else { phrase = new Phrase(LEADING, "", normal); } if (personalInfoField.trim().length() > 0) phrase.add(personalInfoField); if ((index + 1) < size && demoFields.get(index + 1).startsWith("##")) phrase.add("\n\n"); p.add(phrase); document.add(p); index++; } newPage = true; } } }
From source file:org.oscarehr.casemgmt.service.CaseManagementPrintPdf.java
License:Open Source License
public void printAllergies(String demoNo) throws DocumentException { List<String> allergyList = getAllergyData(demoNo); Font obsfont = new Font(bf, FONTSIZE, Font.UNDERLINE); Paragraph p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_CENTER); Phrase phrase = new Phrase(LEADING, "\n\n", font); p.add(phrase);// w w w. ja v a 2 s .c om phrase = new Phrase(LEADING, "Allergies", obsfont); p.add(phrase); document.add(p); Font normal = new Font(bf, FONTSIZE, Font.NORMAL); Font obsfont2 = new Font(bf, 9, Font.UNDERLINE); if (allergyList != null && allergyList.size() > 0) { p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_LEFT); phrase = new Phrase(LEADING, "", obsfont2); phrase.add("DESCRIPTION - SEVERIY - REACTION - DATE\n"); p.add(phrase); document.add(p); for (String allergy : allergyList) { p = new Paragraph(); p.setAlignment(Paragraph.ALIGN_LEFT); phrase = new Phrase(LEADING, "", normal); phrase.add(allergy + "\n"); p.add(phrase); document.add(p); } newPage = true; } }