sb.append(ClientUtil.getResource(location.getLocation(), Location.class).getName());
/** * Returns an encounter location with the specified physical type. * * @param encounter An encounter. * @param physicalType The physical location type sought. * @return The encounter location corresponding to the specified physical type, or null if none * found. */ public static Encounter.Location getLocationByPhysicalType(Encounter encounter, String physicalType) { for (Encounter.Location encounterLocation : encounter.getLocation()) { Location location = ClientUtil.getResource(encounterLocation.getLocation(), Location.class); if (physicalType.equals(location.getPhysicalType().getCodingFirstRep().getCode())) { return encounterLocation; } } return null; }
/** * Encode an encounter to a visit string. * * @param encounter The encounter. * @return The encoded encounter (visit string). */ public static String encode(Encounter encounter) { Location location = ClientUtil.getResource(encounter.getLocationFirstRep().getLocation(), Location.class); String locIEN = location.isEmpty() ? "" : location.getId().getIdPart(); Date date = encounter.getPeriod().getStart(); String sc = getServiceCategory(encounter); String ien = encounter.getId().isEmpty() ? "" : encounter.getId().getIdPart(); return locIEN + VSTR_DELIM + new FMDate(date).getFMDate() + VSTR_DELIM + sc + VSTR_DELIM + ien; }
@Override public void renderItem(Listitem item, Object data) { Encounter encounter = data instanceof Encounter ? (Encounter) data : parse((String) data); item.setValue(encounter); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); Span span = new Span(); span.setSclass(EncounterUtil.isLocked(encounter) ? Constants.SCLASS_LOCKED : null); createCell(item, span); Location location = ClientUtil.getResource(encounter.getLocationFirstRep().getLocation(), Location.class); createCell(item, location == null ? null : location.getName()); createCell(item, encounter.getPeriod().getStart()); createCell(item, encounter.getTypeFirstRep().getCodingFirstRep().getDisplay()); }