One organizes existing health data and the other gathers new inputs. Which is which? Do you need both?
Managing forms and the data collected through them may feel like a chore, but it is crucial for providing high quality healthcare. FHIR’s Questionnaire and QuestionnaireResponse resources are an efficient way to achieve a data collection workflow that is consistent and easy to use.
Yet, the Questionnaire resource is sometimes confused with Compositions, which serve a different, and important role. In this article, we will explore the differences between Questionnaires and Compositions and the role they play in effective healthcare data management.
Quick recap: What is a Questionnaire?#
The FHIR Questionnaire resource defines and communicates forms. It can contain instructional text, questions, and restrictions on the types of answers that are allowed. It also allows questions to be organized into lists or hierarchical groups. Questionnaires also help to ensure that forms recorded via the resource are presented in a standardized and predictable manner.
This is the structure of a Questionnaire, represented in JSON format.
{
"resourceType" : "Questionnaire",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"url" : "<uri>", // Canonical identifier for this questionnaire, represented as an absolute URI (globally unique)
"identifier" : [{ Identifier }], // Business identifier for questionnaire
"version" : "<string>", // Business version of the questionnaire
// versionAlgorithm[x]: How to compare versions. One of these 2:
"versionAlgorithmString" : "<string>",
"versionAlgorithmCoding" : { Coding },
"name" : "<string>", // I Name for this questionnaire (computer friendly)
"title" : "<string>", // Name for this questionnaire (human friendly)
"derivedFrom" : ["<canonical(Questionnaire)>"], // Based on Questionnaire
"status" : "<code>", // I R! draft | active | retired | unknown
"experimental" : <boolean>, // For testing purposes, not real usage
"subjectType" : ["<code>"], // Resource that can be subject of QuestionnaireResponse
"date" : "<dateTime>", // Date last changed
"publisher" : "<string>", // Name of the publisher/steward (organization or individual)
"contact" : [{ ContactDetail }], // Contact details for the publisher
"description" : "<markdown>", // Natural language description of the questionnaire
"useContext" : [{ UsageContext }], // The context that the content is intended to support
"jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for questionnaire (if applicable)
"purpose" : "<markdown>", // Why this questionnaire is defined
"copyright" : "<markdown>", // Use and/or publishing restrictions
"copyrightLabel" : "<string>", // Copyright holder and year(s)
"approvalDate" : "<date>", // When the questionnaire was approved by publisher
"lastReviewDate" : "<date>", // When the questionnaire was last reviewed by the publisher
"effectivePeriod" : { Period }, // When the questionnaire is expected to be used
"code" : [{ Coding }], // Concept that represents the overall questionnaire
"item" : [{ // Questions and sections within the Questionnaire
"linkId" : "<string>", // I R! Unique id for item in questionnaire
"definition" : "<uri>", // ElementDefinition - details for the item
"code" : [{ Coding }], // I Corresponding concept for this item in a terminology
"prefix" : "<string>", // E.g. "1(a)", "2.5.3"
"text" : "<string>", // Primary text for the item
"type" : "<code>", // I R! group | display | boolean | decimal | integer | date | dateTime +
"enableWhen" : [{ // I Only allow data when
"question" : "<string>", // R! The linkId of question that determines whether item is enabled/disabled
"operator" : "<code>", // I R! exists | = | != | > | < | >= | <=
// answer[x]: Value for question comparison based on operator. One of these 10:
"answerBoolean" : <boolean>,
"answerDecimal" : <decimal>,
"answerInteger" : <integer>,
"answerDate" : "<date>",
"answerDateTime" : "<dateTime>",
"answerTime" : "<time>",
"answerString" : "<string>",
"answerCoding" : { Coding },
"answerQuantity" : { Quantity },
"answerReference" : { Reference(Any) }
}],
"enableBehavior" : "<code>", // I all | any
"disabledDisplay" : "<code>", // hidden | protected
"required" : <boolean>, // I Whether the item must be included in data results
"repeats" : <boolean>, // I Whether the item may repeat
"readOnly" : <boolean>, // I Don't allow human editing
"maxLength" : <integer>, // I No more than these many characters
"answerConstraint" : "<code>", // I optionsOnly | optionsOrType | optionsOrString
"answerValueSet" : "<canonical(ValueSet)>", // I ValueSet containing permitted answers
"answerOption" : [{ // I Permitted answer
// value[x]: Answer value. One of these 6:
"valueInteger" : <integer>,
"valueDate" : "<date>",
"valueTime" : "<time>",
"valueString" : "<string>",
"valueCoding" : { Coding },
"valueReference" : { Reference(Any) },
"initialSelected" : <boolean> // Whether option is selected by default
}],
"initial" : [{ // I Initial value(s) when item is first rendered
// value[x]: Actual value for initializing the question. One of these 12:
"valueBoolean" : <boolean>,
"valueDecimal" : <decimal>,
"valueInteger" : <integer>,
"valueDate" : "<date>",
"valueDateTime" : "<dateTime>",
"valueTime" : "<time>",
"valueString" : "<string>",
"valueUri" : "<uri>",
"valueAttachment" : { Attachment },
"valueCoding" : { Coding },
"valueQuantity" : { Quantity },
"valueReference" : { Reference(Any) }
}],
"item" : [{ Content as for Questionnaire.item }] // Nested questionnaire items
}]
}
Here's how a Questionnaire can be represented visually.
Check out our previous article, FHIR Questionnaire Essentials: How to Get Started for more basic information about the Questionnaire resource.
What is a Composition?#
A FHIR Composition resource represents a set of healthcare information that is assembled into a single logical package. It provides a single coherent statement of meaning, contains context and is clinically attested - containing information on who is making the statement.
The Composition resource provides the basic structure of a document - a set of resources that is authored and/or attested by a human, organization or device. These documents can then be exchanged between systems and persisted in document storage and management systems.
A FHIR document instance is a Bundle of type document
that starts with a Composition and contains frozen versions of other resources. For example, a discharge summary would contain information about the Patient, Encounter, Practitioner, Observation and MedicationRequest among other details as last recorded at or before the time of discharge.
This is the structure of a Composition, represented in JSON format.
{
"resourceType" : "Composition",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"url" : "<uri>", // Canonical identifier for this Composition, represented as a URI (globally unique)
"identifier" : [{ Identifier }], // Version-independent identifier for the Composition
"version" : "<string>", // An explicitly assigned identifer of a variation of the content in the Composition
"status" : "<code>", // R! registered | partial | preliminary | final | amended | corrected | appended | cancelled | entered-in-error | deprecated | unknown
"type" : { CodeableConcept }, // R! Kind of composition (LOINC if possible)
"category" : [{ CodeableConcept }], // Categorization of Composition
"subject" : [{ Reference(Any) }], // Who and/or what the composition is about
"encounter" : { Reference(Encounter) }, // Context of the Composition
"date" : "<dateTime>", // R! Composition editing time
"useContext" : [{ UsageContext }], // The context that the content is intended to support
"author" : [{ Reference(Device|Organization|Patient|Practitioner|
PractitionerRole|RelatedPerson) }], // R! Who and/or what authored the composition
"name" : "<string>", // Name for this Composition (computer friendly)
"title" : "<string>", // R! Human Readable name/title
"note" : [{ Annotation }], // For any additional notes
"attester" : [{ // Attests to accuracy of composition
"mode" : { CodeableConcept }, // R! personal | professional | legal | official
"time" : "<dateTime>", // When the composition was attested
"party" : { Reference(Organization|Patient|Practitioner|PractitionerRole|
RelatedPerson) } // Who attested the composition
}],
"custodian" : { Reference(Organization) }, // Organization which maintains the composition
"relatesTo" : [{ RelatedArtifact }], // Relationships to other compositions/documents
"event" : [{ // The clinical service(s) being documented
"period" : { Period }, // The period covered by the documentation
"detail" : [{ CodeableReference(Any) }] // The event(s) being documented, as code(s), reference(s), or both icon
}],
"section" : [{ // Composition is broken into sections
"title" : "<string>", // Label for section (e.g. for ToC)
"code" : { CodeableConcept }, // Classification of section (recommended)
"author" : [{ Reference(Device|Organization|Patient|Practitioner|
PractitionerRole|RelatedPerson) }], // Who and/or what authored the section
"focus" : { Reference(Any) }, // Who/what the section is about, when it is not about the subject of composition
"text" : { Narrative }, // I Text summary of the section, for human interpretation
"orderedBy" : { CodeableConcept }, // Order of section entries
"entry" : [{ Reference(Any) }], // I A reference to data that supports this section
"emptyReason" : { CodeableConcept }, // I Why the section is empty
"section" : [{ Content as for Composition.section }] // Nested Section
}]
}
This is how a Composition can be visualized. This image is sourced from the blog Hay on FHIR
QuestionnaireResponse vs Composition#
The QuestionnaireResponse and Composition resources are similar in that they organize items and can have hierarchical structures. They are also intended to guide the presentation of data to enable human understanding.
However, Compositions organize resources (both human and computer readable) and Questionnaires/QuestionnaireResponses organize specific elements such as questions/answers or instructions.
A Questionnaire represents data that is ‘to be gathered’ and is not dependent on a subject. A Composition represents a complete collection of data usually about a particular subject.
Final thoughts#
Accurate collection and management of form-based data is a critical component of hospital information management. FHIR resources like Questionnaire and QuestionnaireResponse provide a great deal of standardization and flexibility for structuring data collection workflows. They ensure consistency and reduce cognitive load by providing predictable interfaces.
The Composition resource organizes existing healthcare data into coherent and clinically attested documents, e.g. discharge summaries. While both resources support hierarchical organization of information, the Questionnaire focuses on data-to-be-collected whereas the Composition aggregates existing data into human-readable documents.
Become a FHIR expert in just 90 minutes with our free FHIR masterclass. Click here to register now.