/** * Used to sort patient list items alphabetically by patient name. */ @Override public int compareTo(PatientListItem item) { String name1 = FhirUtil.formatName(patient.getName()); String name2 = FhirUtil.formatName(item.patient.getName()); return name1.compareToIgnoreCase(name2); } }
private void setPatient(Patient patient) { this.patient = patient; hideLabels(); needsDetail = true; pnlDetail.destroyChildren(); if (log.isDebugEnabled()) { log.debug("patient: " + patient); } if (patient == null) { lblName.setLabel(noSelection); btnDetail.setDisabled(true); return; } btnDetail.setDisabled(false); patientName = FhirUtil.formatName(patient.getName()); String mrn = FhirUtil.getMRNString(patient); lblName.setLabel(patientName + (mrn.isEmpty() ? "" : " (" + mrn + ")")); setLabel(lblDOB, formatDateAndAge(patient.getBirthDate()), lblDOBLabel); setLabel(lblDOD, formatDOD(patient.getDeceased()), lblDODLabel); setLabel(lblGender, patient.hasGender() ? patient.getGender().getDisplay() : null, null); }
private void setPatient(Patient patient) { this.patient = patient; hideLabels(); needsDetail = true; ZKUtil.detachChildren(pnlDetail); if (log.isDebugEnabled()) { log.debug("patient: " + patient); } if (patient == null) { lblName.setValue(noSelection); lblName.setSclass("z-bandbox-disabled"); btnDetail.setDisabled(true); return; } btnDetail.setDisabled(false); patientName = FhirUtil.formatName(patient.getName()); String mrn = FhirUtil.getMRNString(patient); lblName.setValue(patientName + (mrn.isEmpty() ? "" : " (" + mrn + ")")); lblName.setSclass(null); setLabel(lblDOB, formatDateAndAge(patient.getBirthDate()), lblDOBLabel); setLabel(lblDOD, formatDOD(patient.getDeceased()), lblDODLabel); setLabel(lblGender, patient.hasGender() ? patient.getGender().getDisplay() : null, null); Clients.resize(root); }
/** * Retrieves a formatted header for the current patient. * * @return Formatted header. */ public String getPatientInfo() { Patient patient = PatientContext.getActivePatient(); String text; if (patient == null) { text = "No Patient Selected"; } else { Identifier mrn = FhirUtil.getMRN(patient); // May be null! text = FhirUtil.formatName(patient.getName()); if (mrn != null) { text += " #" + mrn.getValue(); } String gender = patient.hasGender() ? patient.getGender().getDisplay() : ""; if (!StringUtils.isEmpty(gender)) { text += " (" + gender + ")"; } Date deceased = patient.getDeceased() instanceof DateType ? ((DateType) patient.getDeceased()).getValue() : null; String age = DateUtil.formatAge(patient.getBirthDate(), true, deceased); text += " Age: " + age; if (deceased != null) { text += " Died: " + DateUtil.formatDate(deceased); } } return text; }
String nm = FhirUtil.formatName(name);
String nm = FhirUtil.formatName(name);
photo.setSrc(Util.getImage(patient.getPhoto(), Util.SILHOUETTE_IMAGE).getSrc()); root.addChild(photo); addDemographic(root, null, FhirUtil.formatName(patient.getName()), "font-weight: bold"); addDemographic(root, "mrn", FhirUtil.getMRNString(patient)); addDemographic(root, "gender", patient.getGender());
@Override public void committed() { Patient patient = PatientContext.getActivePatient(); AImage image = patient == null ? null : Util.getImage(patient.getPhoto()); if (patient == null) { imgPhoto.setSrc(Util.NOPATIENT_IMAGE); imgPhoto.setTooltip((Popup) null); imgPhoto.setTooltiptext(Labels.getLabel("patientphoto.no.patient")); } else if (image == null) { imgPhoto.setSrc(Util.SILHOUETTE_IMAGE); imgPhoto.setTooltip((Popup) null); imgPhoto.setTooltiptext(Labels.getLabel("patientphoto.no.photo")); } else { imgPhoto.setContent(image); imgPhoto.setTooltiptext(null); imgPhoto.setTooltip(popup); imgFullPhoto.setContent(image); lblCaption.setValue( patient == null ? "" : FhirUtil.formatName(patient.getName(), NameUse.USUAL, NameUse.OFFICIAL, null)); } }