View on GitHub


The official .NET API for HL7 FHIR

Download this project as a .zip file Download this project as a tar.gz file

Tags in Bundles

Tags can be added to Resources and Bundles using the Tags property of either a BundleEntry or a Bundle:

entry.Tags.Add( new Tag("", Tag.FHIRTAGSCHEME_GENERAL) );

In this example a Tag with the term within the General FHIR tag scheme is created and added to an entry. When serialized, these Tags are rendered as <category> elements on the Atom feed or entry.

The specification currently defines three supported schemes:

TypeScheme url.NET constant
General tags
Profile tags
Security labels

The specification additionally defines several terms within the General scheme to indicate human-readable labels and a discriminator for types of Bundles (either Document or Message). Instead of explicitly adding Tags, supplying the scheme and using the prescribed terms, the API provides convenience methods to attain the same goals, for example:

entry.SetTextTag("I am adding a textual note");
entry.AddProfileAssertion(new Uri(""));
IEnumerable<Uri> labels = entry.GetSecurityLabels();


Since Atom entries and feeds may contain any number of non-FHIR category elements, the API contains methods to filter a list of Tags on one or more specific schemes:

var categories = entry.Tags;
var fhirTags = categories.FilterFhirSchemes();
var generalTags = categories.FilterByScheme(Tag.FHIRTAGSCHEME_GENERAL)