Path | Short | Definition | Comments |
---|---|---|---|
Compartment Definition for a resource | A compartment definition that defines how resources are accessed on a server. | In FHIR, search is not performed directly on a resource (by XML or JSON path), but on a named parameter that maps into the resource content. | |
url | Canonical identifier for this compartment definition, represented as a URI (globally unique) | An absolute URI that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this compartment definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the compartment definition is stored on different servers. | Can be a urn:uuid: or a urn:oid: but real http: addresses are preferred. Multiple instances may share the same URL if they have a distinct version. The determination of when to create a new version of a resource (same url, new version) vs. defining a new artifact is up to the author. Considerations for making this decision are found in [Technical and Business Versions](resource.html#versions). In some cases, the resource can no longer be found at the stated url, but the url itself cannot change. Implementations can use the [meta.source](resource.html#meta) element to indicate where the current master source of the resource can be found. |
version | Business version of the compartment definition | The identifier that is used to identify this version of the compartment definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the compartment definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. | There may be different compartment definition instances that have the same identifier but different versions. The version can be appended to the url in a reference to allow a reference to a particular business version of the compartment definition with the format [url]|[version]. |
name | Name for this compartment definition (computer friendly) | A natural language name identifying the compartment definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. | The name is not expected to be globally unique. The name should be a simple alphanumeric type name to ensure that it is machine-processing friendly.This is often the same as the code for the parameter, but does not need to be. |
status | draft | active | retired | unknown | The status of this compartment definition. Enables tracking the life-cycle of the content. | Allows filtering of compartment definitions that are appropriate for use versus not. |
experimental | For testing purposes, not real usage | A Boolean value to indicate that this compartment definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. | Allows filtering of compartment definitions that are appropriate for use versus not. |
date | Date last changed | The date (and optionally time) when the compartment definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. | Note that this is not the same as the resource last-modified-date, since the resource may be a secondary representation of the compartment definition. Additional specific dates may be added as extensions or be found by consulting Provenances associated with past versions of the resource. |
publisher | Name of the publisher (organization or individual) | The name of the organization or individual that published the compartment definition. | Usually an organization but may be an individual. The publisher (or steward) of the compartment definition is the organization or individual primarily responsible for the maintenance and upkeep of the compartment definition. This is not necessarily the same individual or organization that developed and initially authored the content. The publisher is the primary point of contact for questions or issues with the compartment definition. This item SHOULD be populated unless the information is available from context. |
contact | Contact details for the publisher | Contact details to assist a user in finding and communicating with the publisher. | May be a web site, an email address, a telephone number, etc. |
description | Natural language description of the compartment definition | A free text natural language description of the compartment definition from a consumer's perspective. | This description can be used to capture details such as why the compartment definition was built, comments about misuse, instructions for clinical use and interpretation, literature references, examples from the paper world, etc. It is not a rendering of the compartment definition as conveyed in the 'text' field of the resource itself. This item SHOULD be populated unless the information is available from context (e.g. the language of the compartment definition is presumed to be the predominant language in the place the compartment definition was created). |
useContext | The context that the content is intended to support | The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate compartment definition instances. | When multiple useContexts are specified, there is no expectation that all or any of the contexts apply. |
purpose | Why this compartment definition is defined | Explanation of why this compartment definition is needed and why it has been designed as it has. | This element does not describe the usage of the compartment definition. Instead, it provides traceability of ''why'' the resource is either needed or ''why'' it is defined as it is. This may be used to point to source materials or specifications that drove the structure of this compartment definition. |
code | Patient | Encounter | RelatedPerson | Practitioner | Device | Which compartment this definition describes. | Only the specification can define the compartments that can exist. Servers can choose to support them. |
search | Whether the search syntax is supported | Whether the search syntax is supported,. | Servers may define and use compartments to manage logical access without implementing the compartment related syntax. |
resource | How a resource is related to the compartment | Information about how a resource is related to the compartment. | |
resource.id | Unique id for inter-element referencing | Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. | |
resource.extension | Additional content defined by implementations | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. | There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. |
resource.modifierExtension | Extensions that cannot be ignored even if unrecognized | May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). | There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. |
resource.code | Name of resource type | The name of a resource supported by the server. | |
resource.param | Search Parameter Name, or chained parameters | The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment in more than one way,. | If no search parameters are listed, then the resource is not linked to the compartment. |
resource.documentation | Additional documentation about the resource and compartment | Additional documentation about the resource and compartment. |
Each resource may belong to one or more logical compartments. A compartment is a logical grouping of resources which share a common property. Compartments have two principal roles:
Note:
At present, compartment definitions can only be defined by HL7 International. This is because their existence creates significant impact on the behavior of servers.
Compartment definitions describe how particular compartment instances are named and identified, and how systems know which resources are in the compartment. The following compartments are defined by this specification:
<%compartmentlist%>
The full definitions of these compartments are published as CompartmentDefinition
resources. Servers typically do not support the full definition of a compartment, and are not
required to. Systems may publish CompartmentDefinition
resources so that
other systems may make use of compartments properly.
As an example of compartment usage, to retrieve a list of a patient's conditions, use the URL:
GET [base]/Patient/[id]/Condition
Additional search parameters can be defined, such as this hypothetical search for acute conditions:
GET [base]/Patient/[id]/Condition?code:in=http://hspc.org/ValueSet/acute-concerns
Note that as searches, these are syntactic variations on these two search URLs respectively:
GET [base]/Condition?patient=[id] GET [base]/Condition?patient=[id]&code:in=http://hspc.org/ValueSet/acute-concerns
The outcome of a compartment search is the same as the equivalent normal search. For example, both these searches return the same outcome if there is no patient 333:
GET [base]/Patient/333/Condition GET [base]/Condition?patient=333
Whether the patient doesn't exist, or the user has no access to the patient, both these searches return an empty bundle with no matches. Some systems will include an operation outcome warning that there is no matching patient.
However, there is a key difference in functionality between compartment based searches and direct searches with parameters. Consider this search:
GET [base]/Patient/[id]/Communication
Because the definition of the patient compartment for Communication says that a Communication resource is in the patient compartment if the subject, sender, or recipient is the patient, the compartment search is actually the same as the union of these 3 searches:
GET [base]/Communication?subject=[id] GET [base]/Communication?sender=[id] GET [base]/Communication?recipient=[id]
There is no way to do this as a single search, except by using the _filter:
GET [base]/Communication?_filter=subject re [id] or sender re [id] or recipient re [id]
Further details of searching by compartment are described under the search operation. As a search related operation, the assignment of resources to compartments is only based on the current version of any of the resources involved. Note that contained patient resources cannot create a patient compartment of their own.
Note that while this specification describes how to use the compartment syntax to find resources that are logically associated with the compartment, the compartment is not part of the identity of the resource. E.g. the response to the following is not defined by this specification:
GET [base]/Patient/[patient-id]/Condition/[resource-id]
The response for write operations (PUT/DELETE/PATCH) are also not defined by this specification. Nor is the response to a POST defined:
POST [base]/Patient/[patient-id]/Condition
There is no expectation for servers to support either read or write to such URLs.
Compartments may be used explicitly, like this, but can also be used implicitly. For instance, if a FHIR server is providing a patient view of a record, the authorized user associated with use of the FHIR RESTful API may be limited to accessing records from the compartment instance(s) logically associated with their identity. Irrespective of whether compartments are being used explicitly or implicitly, servers will need to make arrangements to make some resources with no direct link to a patient available to the client (medications, substances, etc.).
Note that resources may cross between compartments, or interlink them. Examples of this would be where a Diagnostic Report identifies a subject, but an Observation it references identifies a different subject, or where a List resource references items that identify different subjects. Such cross-linking may arise for many valid reasons, including:
Given the wide variety of use cases and contexts in which FHIR is used, compartments do not define how cross-linking is handled. Systems may reject resources, remove them from both compartments, or place them in both, or act in some other fashion.
The graph definition resource provides a method by which rules about cross-linking may be made and enforced.
It is at the discretion of the server whether to include resources in a compartment when the reference to the resource that establishes the compartment is in an extension.
Some resources are not in any compartment, e.g. Medication, Substance, Location. These resources are not linked directly to a patient or authored record, and are sometimes called 'master files'. Servers will need to make arrangements to make these resources available to the clients that are limited to particular compartments. For example, a Medication resource describes a medication itself and does not link to a patient; however, a resource such as MedicationAdministration connects the Medication (details of what was administered) to the patient (for whom was it administered), and so is required to interpret the administration.
Compartments are defined and added to the list above when implementer communities identify them as common access points for data. As described below, compartments have both syntactical and logical consequences, and both these aspects of their functionality are evaluated when deciding whether to define compartments.
code | Patient | Encounter | RelatedPerson | Practitioner | Device | CompartmentDefinition.code |
resource | Name of resource type | CompartmentDefinition.resource.code |