/** * 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); } }
@SuppressWarnings("unchecked") @Override protected Object transformData(Object data) { if (data instanceof IBaseDatatype) { return FhirUtil.getDisplayValueForType((IBaseDatatype) data); } if (data instanceof List) { List<?> c = (List<?>) data; if (c.isEmpty()) { return ""; } if (c.get(0) instanceof IBaseDatatype) { return FhirUtil.getDisplayValueForTypes((List<IBaseDatatype>) c, ", "); } } return super.transformData(data); }
private String getReactions(List<AllergyIntoleranceReactionComponent> reactions) { StringBuilder sb = new StringBuilder(); for (AllergyIntoleranceReactionComponent reaction : reactions) { String severity = reaction.hasSeverity() ? " (" + reaction.getSeverity().getDisplay() + ")" : ""; String manifestation = reaction.hasManifestation() ? FhirUtil.getDisplayValue(reaction.getManifestation().get(0)) : ""; sb.append(sb.length() == 0 ? "" : ", "); sb.append(manifestation).append(severity); } return sb.toString(); }
String nm = FhirUtil.formatName(name); String language = FhirUtil.getDisplayValueForType(comm.getLanguage());
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); }
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()); addContact(root, patient.getTelecom(), "work:fax", "work fax"); Address address = FhirUtil.getAddress(patient.getAddress(), AddressUse.HOME);
/** * 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; }
HumanName name = FhirUtil.getName(patient.getName(), NameUse.USUAL, null); name = FhirUtil.parseName(StrUtil.getLabel("patientselection.warn.unknown.patient")); addCell(row, FhirUtil.getMRNString(patient), max);
/** * Extracts results from the returned bundle. Override for special processing. * * @param bundle The bundle. * @return List of extracted resources. */ protected List<R> processBundle(Bundle bundle) { return FhirUtil.getEntries(bundle, resourceClass); }
@Override protected void render(FamilyMemberHistory relation, List<Object> columns) { columns.add(relation.getRelationship()); for (int i = 0; i < 3; i++) { Vlayout cmp = new Vlayout(); columns.add(cmp); for (FamilyMemberHistoryConditionComponent condition : relation.getCondition()) { String value = null; switch (i) { case 0: value = FhirUtil.getDisplayValue(condition.getCode()); break; case 1: value = FhirUtil.getDisplayValue(condition.getOutcome()); break; case 2: value = FhirUtil.getDisplayValueForTypes(condition.getNote(), "\n\n"); break; } cmp.appendChild(new Label(value)); } } }
private void append(StringBuilder sb, IBaseDatatype value, String delimiter) { append(sb, FhirUtil.getDisplayValueForType(value), delimiter); }
/** * Sort by patient full name, ignoring case. * * @param patient1 First patient to compare. * @param patient2 Second patient to compare. * @return Result of comparison. */ @Override public int compare(Patient patient1, Patient patient2) { HumanName name1 = FhirUtil.getName(patient1.getName(), NameUse.USUAL, null); HumanName name2 = FhirUtil.getName(patient2.getName(), NameUse.USUAL, null); String cmp1 = name1 == null ? "" : name1.toString(); String cmp2 = name2 == null ? "" : name2.toString(); return cmp1.compareToIgnoreCase(cmp2.toString()); }
/** * Creates a CCOW context from the specified patient object. */ @Override public ContextItems toCCOWContext(Patient patient) { Identifier mrn = FhirUtil.getMRN(patient); contextItems.setItem(CCOW_MRN, mrn == null ? null : mrn.getValue(), "MRN"); contextItems.setItem(CCOW_NAM, patient.getName()); contextItems.setItem(CCOW_SEX, patient.getGender()); contextItems.setItem(CCOW_DOB, patient.getBirthDate()); return contextItems; }
String nm = FhirUtil.formatName(name); String language = FhirUtil.getDisplayValueForType(comm.getLanguage());
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); }
@Override protected List<IBaseResource> processBundle(Bundle bundle) { return FhirUtil.getEntries(bundle, null, Collections.singletonList(Patient.class)); }
@Override protected void render(Observation observation, List<Object> columns) { columns.add(observation.getCode()); columns.add(observation.getEffective()); columns.add(observation.getStatus()); columns.add(observation.getValue()); if (observation.hasReferenceRange()) { columns.add(FhirUtil.getFirst(observation.getReferenceRange()).getText()); } else { columns.add(""); } }
@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)); } }