@Override public String getCode() { return getTerm(); }
public Tag getTag(String theScheme, String theTerm) { for (Tag next : this) { if (theScheme.equals(next.getScheme()) && theTerm.equals(next.getTerm())) { return next; } } return null; }
public String toHeaderValue() { StringBuilder b = new StringBuilder(); b.append(this.getTerm()); if (isNotBlank(this.getLabel())) { b.append("; label=\"").append(this.getLabel()).append('"'); } if (isNotBlank(this.getScheme())) { b.append("; scheme=\"").append(this.getScheme()).append('"'); } return b.toString(); }
@SuppressWarnings("unused") public void getResourceTags() { // START SNIPPET: getResourceTags IGenericClient client = FhirContext.forDstu2().newRestfulGenericClient("http://fhir.healthintersections.com.au/open"); Patient p = client.read(Patient.class, "1"); // Retrieve the list of tags from the resource metadata TagList tags = ResourceMetadataKeyEnum.TAG_LIST.get(p); // tags may be null if no tags were read in if (tags == null) { System.out.println("No tags!"); } else { // You may iterate over all the tags for (Tag next : tags) { System.out.println(next.getScheme() + " - " + next.getTerm()); } // You may also get a list of tags matching a given scheme List<Tag> someTags = tags.getTagsWithScheme("http://hl7.org/fhir/tag"); // Or a specific tag (by scheme and term) Tag specificTag = tags.getTag("http://hl7.org/fhir/tag", "http://foo"); } // END SNIPPET: getResourceTags }
writeOptionalTagWithValue(theEventWriter, "code", tag.getTerm()); writeOptionalTagWithValue(theEventWriter, "display", tag.getLabel()); theEventWriter.writeEndElement();
@Override public String getCode() { return getTerm(); }
if (tagList != null) { for (Tag next : tagList) { TagDefinition def = getTagOrNull(TagTypeEnum.TAG, next.getScheme(), next.getTerm(), next.getLabel()); if (def != null) { ResourceTag tag = theEntity.addTag(def);
public Tag getTag(String theScheme, String theTerm) { for (Tag next : this) { if (theScheme.equals(next.getScheme()) && theTerm.equals(next.getTerm())) { return next; } } return null; }
writeOptionalTagWithTextNode(theEventWriter, "code", tag.getTerm()); writeOptionalTagWithTextNode(theEventWriter, "display", tag.getLabel()); theEventWriter.endObject();
@Override public IBaseCoding getTag(String theSystem, final String theCode) { for (final Tag next : ResourceMetadataKeyEnum.TAG_LIST.get(BaseResource.this)) { if (next.getScheme().equals(theSystem) && next.getTerm().equals(theCode)) { return next; } } return null; }
public String toHeaderValue() { StringBuilder b = new StringBuilder(); b.append(this.getTerm()); if (isNotBlank(this.getLabel())) { b.append("; label=\"").append(this.getLabel()).append('"'); } if (isNotBlank(this.getScheme())) { b.append("; scheme=\"").append(this.getScheme()).append('"'); } return b.toString(); }
writeOptionalTagWithValue(theEventWriter, "code", tag.getTerm()); writeOptionalTagWithValue(theEventWriter, "display", tag.getLabel()); theEventWriter.writeEndElement();
if (tagList != null) { for (Tag next : tagList) { TagDefinition def = getTagOrNull(TagTypeEnum.TAG, next.getScheme(), next.getTerm(), next.getLabel()); if (def != null) { ResourceTag tag = theEntity.addTag(def);
writeOptionalTagWithTextNode(theEventWriter, "code", tag.getTerm()); writeOptionalTagWithTextNode(theEventWriter, "display", tag.getLabel()); theEventWriter.endObject();