Basic
Introduction
Scope and Usage
Basic is a special type of resource. Unlike all other resources, it doesn't correspond to a specific pre-defined HL7 concept. Instead, it's a placeholder for any resource-like concept that isn't already defined in the HL7 specification.
The Basic resource is intended for use in three circumstances:
- When an implementer needs a resource concept that is likely to be defined by HL7 in the future but they have not yet done so (due to bandwidth issues, lack of sufficient requirements, lower prioritization, etc.)
- When there's a need to convey a narrative-only construct that doesn't neatly correspond to one of the other resources, either because it combines aspects of several resources (e.g. Assessment + Plan) or because the allowed content is flexible such that the system can't be totally sure what sort of content might have been included in the narrative text.
- Other than the circumstances above, this resource will see minimal use. To keep the FHIR specification managable, it cannot incorporate every site-specific requirement that might be needed in some implementation somewhere. This set of resources likely won't ever be officially defined in HL7.
There's also a fourth circumstance: An implementer wishes to convey information that could/should be conveyed using a standard resource, however they want to represent the information in a custom format that isn't aligned with the official resource's elements. While this resource would be the preferred way of meeting that use-case because it will at least be wire-format compatible, such a use would not be conformant because making use of the Basic resource would prevent the healthcare-related information from being safely processed, queried and analyzed by other conformant systems.
Implementers don't need to be concerned with which of the three categories their desired resource fits within. If they need a resource and it clearly doesn't fit one of the ones currently defined, they should use Basic.
[%stu-note dstu%] That the inter-version extension mechanism might be used to allow Basic to represent resources that don't exist in the FHIR version being used for exchange, but no specific guidance is provided. If implementers are interested in having this further defined, they should share their use-case on http://chat.fhir.org and the committee might consider publishing out an implementation guide providing further guidance. [%end-note%]
Background and Context
Basic defines only a minimal set of data elements - those necessary to identify what kind of resource it represents and those necessary to support resource compartmenting. All other data elements are represented using the extension mechanism. It's entirely possible to have a Basic resource instance with nothing other than narrative, a subject and code. And, in practice, that's all many systems will understand.
Boundaries and Relationships
The Basic resource can potentially represent any resource. However, wherever another resource can be used instead of Basic, that resource should always be used.
Other resources that are commonly used to capture 'generic' data are listed below:
- Observation is preferable to Basic when the data being captured is a point-in-time assertion, particularly if it's potentially subjective and when notions such as 'method' or 'performer' of - how the data was captured are relevant.
- Questionnaire is appropriate when the focus is on how the data is gathered from the user and where the resulting data won't be directly searchable.
- Parameters are used when invoking operations or possibly passing information into a messaging call.
- DocumentReference can be used to encapsulate arbitrary data so long as there is a mime type that corresponds to that structure. However, such data is typically opaque to FHIR queries.
Notes
Why not custom resources?
Technically, nothing prevents implementers from going off and defining their own resources containing whatever data elements they wish. However, doing so causes several issues:
- Custom resources don't have a discoverability mechanism in the same way custom codes and extensions do using the ValueSet and StructureDefinition resources. As a result, any implementer that receives a custom resource would have no way of looking up what the meaning of the resource or its elements were. While they could get some sense of meaning from XML or JSON tag names, this often isn't sufficient for safe healthcare interoperability.
- Custom resource names would not be present in the FHIR schemas as allowed elements within the FHIR Bundle schema, would not be present in the enumeration of resources in the Reference type, and would not be supported by any of the autogenerated reference implementations and software interfaces. This would cause issues for any receiving system making use of the schemas directly or via code-generation.
- There is no means of preventing two implementers from independently coming up with the same name for a resource but defining it differently in terms of meaning as well as allowed elements. This would also cause interoperability issues.
All of these concerns are mitigated when there's an assumption that the custom resource will only be used within a narrow constrained environment where all participants will be aware of the semantics, will be using the same custom schemas and there's no chance of collisions. However, HL7's experience is that closed implementation environments rarely remain that way over the long term. Eventually data will need to be shared with others outside the closed environment and all of the above issues will again come into play.
Therefore, use of 'custom' resources is NOT considered to be conformant with FHIR. While the use of extensions may make the Basic resource slightly more complex and less visually appealing, it is the only safe and approved mechanism for sharing resource concepts not representable using standard HL7-defined resources.
Documents and narrative-only resources
Documents are constructed of sections, where a key part of each section is the narrative. The narratives are stitched together to form the overall text of the document. Many document sections will correspond neatly to resources that are already defined - List, DiagnosticReport, FamilyMemberHistory, etc. However, oddly enough, alignment with FHIR resources isn't always in mind when clinicians and others design documents, and some sections won't neatly align with the boundaries of resources. Sometimes there's simply a need for a place where a document author can say "stuff" without any particular constraints on what they may choose to talk about. Basic is intended to provide a mechanism to handle those circumstances.
Wherever possible, the "standard" FHIR resources SHOULD be used, even for narrative-only content. That's because subsequent revisions of the narrative-only content might choose to encode pieces or even all of the narrative content. Encoding can occur with "Basic" as well. Extensions can point to other resources (contained or stand-alone) that fully encode pieces of the free-form narrative found in the Basic resource. If no appropriate other resource exists for the meaning of the content, extensions can also be used.
Referencing Basic resources
None of the standard resources will have direct references to Basic, aside from those that allow linking to "Any" resource. As a result, most references to "Basic" will need to be performed using extensions.
Basic as a Canonical Resource Wrapper
When using cross-version extensions to represent canonical resources that do not exist in the FHIR version being used (such as resource types introduced in later FHIR versions), the Basic resource can serve as a wrapper to represent those canonical resources. In such cases:
- The Basic resource can be treated as representing a canonical resource for referencing purposes
- References to the Basic resource from cross-version extensions can use canonical reference patterns
- The
codeelement SHALL identify that the Basic instance represents a canonical resource type
This pattern enables implementers to work with canonical resources from other FHIR versions while maintaining compatibility with version-specific infrastructure. See the versions page and the cross-version extension packages for more details on this approach.
Search Parameters against Basic
Custom SearchParameters can be defined against a Basic resource profile in the same manner as any other resource. However, because of the wide range of concepts that can be conveyed via Basic, the opportunity for collisions in the naming of search parameters is higher. While collisions can be resolved using the standard mechanism (checking parameter codes via the CapabilityStatement and resolving canonical definitions), best practice is for search parameter codes to include the conceptual resource name represented as a prefix. For example, rather than defining a search parameter called effectiveDate, it would be better to have the search parameter code be application-renewal-effective-date. This same convention is recommended if leveraging Basic to represent resources during inter-version conversion (e.g., a future or legacy resource). For example, a search parameter might be coded as personal-relationship-source rather than just source.
Note that authors and implementers MAY still define and support non-prefixed codes; this guidance is an aid to interoperability and governance.
Best practices for using 'Basic'
There are several good practices to follow when making use of the Basic resource:
- Before using Basic, post a description of the desired resource type on chat.fhir.org or on Stack Overflow to see whether the use-case can be met by an existing resource. (Sometimes the intended scope of an existing resource won't be clear, even if the intent is to cover your space.) Using an existing resource is usually preferable to using Basic as it significantly increases the likelihood of interoperability.
- If an existing resource would normally be a good fit for your use-case but can't be used due to overly prescriptive constraints your implementation is unable to meet, again raise the problem on Stack Overflow so the problem with the specification can be addressed.
- If it is necessary to make use of the Basic resource, try to use one of the HL7-defined codes for resource type or submit your requirement for a new type for inclusion in the HL7 vocabulary (using the Propose a change link), as this will increase the likelihood of interoperability. Alternate code systems are conformant, but are less likely to be recognized or re-used across the healthcare implementation space.
- Architect your interface in a way that will make it less painful to swap your use of Basic with an 'official' resource in the event that a future release of FHIR formally defines a resource that encompasses your use-case.
- Use a StructureDefinition to define the extensions relevant to each type of other resource used. Profiles can also be used to define additional search criteria appropriate for the resource.
- When defining a profile on Basic, include mappings to the w5 categories to allow systems to easily manage AuditEvent and Provenance uses as well as other potential higher-level abstractions of the data.
- As well, profiles should consider how best to handle common notions such as "entered in error" status and alignment with common practices within similar resource families (other request resources, medication-related resources), etc.
StructureDefinition
Elements (Simplified)
- Basic [0..*]: - Resource for non-supported content
- Basic.identifier [0..*]: Identifier Business identifier
- Basic.code [1..1]: CodeableConcept extensible:version-independent-resource-types Kind of Resource
- Basic.subject [0..1]: Reference(Resource) Identifies the focus of this resource
- Basic.created [0..1]: dateTime When created
- Basic.author [0..1]: [Reference(Practitioner](/Reference(Practitioner), PractitionerRole, Patient, RelatedPerson, Organization, Device, CareTeam)) Who created
Mappings
- Basic Mappings — 12 mapping entries
Resource Packs
list-Basic-packs.xml
<?xml version="1.0" encoding="UTF-8"?>
<List xmlns="http://hl7.org/fhir">
<id value="Basic-packs"/>
<status value="current"/>
<mode value="working"/>
</List>
Search Parameters
- author — reference — Who created —
Basic.author - code — token — Kind of Resource —
Basic.code - created — date — When created —
Basic.created - identifier — token — Business identifier —
Basic.identifier - patient — reference — Identifies the focus of this resource —
Basic.subject.where(resolve() is Patient) - subject — reference — Identifies the focus of this resource —
Basic.subject
Examples
- basic-example — basic-example
- basic-example-narrative — basic-example-narrative — A resource that uses all narrative features for testing rendering applications
- basic-example2 — basic-example2
- basic-examples-header — basic-examples-header
- classModel — basic-example2 — How 'Basic' can be used for essoteric resources - in this case, a UML class model
- referral — basic-example — How 'basic' can be used for future resources - in this case referral
Mapping Exceptions
basic-fivews-mapping-exceptions.xml
Divergent Elements
- FiveWs.what[x] → Basic.code
Unmapped Elements
- FiveWs.actor — This may be relevant, but will be handled as an extension
- FiveWs.cause — This may be relevant, but will be handled as an extension
- FiveWs.version — This may be relevant, but will be handled as an extension
- FiveWs.witness — This may be relevant, but will be handled as an extension
- FiveWs.class — This may be relevant, but will be handled as an extension
- FiveWs.where — This may be relevant, but will be handled as an extension
- FiveWs.context — This may be relevant, but will be handled as an extension
- FiveWs.init — This may be relevant, but will be handled as an extension
- FiveWs.why — This may be relevant, but will be handled as an extension
- FiveWs.source — This may be relevant, but will be handled as an extension
- FiveWs.who — This may be relevant, but will be handled as an extension
- FiveWs.grade — This may be relevant, but will be handled as an extension
- FiveWs.status — This may be relevant, but will be handled as an extension
- FiveWs.planned — This may be relevant, but will be handled as an extension
- FiveWs.done — This may be relevant, but will be handled as an extension