private void addHeader(String text) { Label header = new Label(text); header.addClass("cwf-patientheader-header"); pnlDetail.addChild(header); }
/** * Override to bind wrapped components to the UI. */ protected void bind() { getParent().getInnerComponent().addChild(getOuterComponent()); }
/** * Adds a demographic element to the demographic panel. * * @param root Root component. * @param labelId The id of the label to use. * @param object The element to be added. * @param style CSS styling to apply to element (may be null). */ protected void addDemographic(BaseUIComponent root, String labelId, Object object, String style) { object = object instanceof PrimitiveType ? ((PrimitiveType<?>) object).getValue() : object; String value = object == null ? null : object instanceof Date ? DateUtil.formatDate((Date) object) : object.toString().trim(); if (!StringUtils.isEmpty(value)) { Label lbl = new Label((labelId == null ? "" : getDemographicLabel(labelId) + ": ") + value); root.addChild(lbl); if (style != null) { lbl.addStyles(style); } } }
private void addDetail(String text, String label) { if (StringUtils.isEmpty(text)) { return; } Div div = new Div(); pnlDetail.addChild(div); if (label != null) { Label lbl = new Label(label); lbl.addClass("cwf-patientheader-label"); div.addChild(lbl); } div.addChild(new Label(text)); }
@Override public void bind() { setTreeView(getAncestor(ElementTreeView.class)); treeView.getInnerComponent().addChild(pane); getNodeParent().addChild(node); }
protected void renderDemographics(Patient patient, BaseUIComponent root) { root.addChild(new Div()); Image photo = new Image(); photo.setStyles("max-height:300px;max-width:300px;padding-bottom:10px"); 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)); root.addChild(new Div());