sb.append(ClientUtil.getResource(location.getLocation(), Location.class).getName());
/** * Adds and returns a new value for <b>location</b> () * * <p> * <b>Definition:</b> * List of locations where the patient has been during this encounter * </p> */ public Location addLocation() { Location newType = new Location(); getLocation().add(newType); return newType; }
public static Encounter create(Patient patient, Date date, Location location, String sc) { Encounter encounter = new Encounter(); ResourceReferenceDt pat = new ResourceReferenceDt(patient); encounter.setPatient(pat); PeriodDt period = new PeriodDt(); period.setStart(new DateTimeDt(date)); encounter.setPeriod(period); ResourceReferenceDt loc = new ResourceReferenceDt(location); Encounter.Location encloc = encounter.addLocation(); encloc.setPeriod(period); encloc.setLocation(loc); CodeableConceptDt type = encounter.addType(); CodeableConceptDt cat = getServiceCategory(sc); type.setText(cat.getText()); type.setCoding(cat.getCoding()); return encounter; }
/** * 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()); }
/** * Gets the value(s) for <b>status</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time * </p> */ public String getStatus() { return getStatusElement().getValue(); }
public static boolean isPrepared(Encounter encounter) { return encounter != null && !encounter.getLocationFirstRep().isEmpty() && !encounter.getParticipantFirstRep().isEmpty() && getServiceCategory(encounter) != null; }
/** * Sets the value(s) for <b>status</b> () * * <p> * <b>Definition:</b> * The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time * </p> */ public Location setStatus(EncounterLocationStatusEnum theValue) { setStatus(new BoundCodeDt<EncounterLocationStatusEnum>(EncounterLocationStatusEnum.VALUESET_BINDER, theValue)); /* getStatusElement().setValueAsEnum(theValue); */ return this; }