Skip to main content
v2026.11,986 entries · CC-BY 4.0

FHIR QuestionnaireResponse Resource: Required Fields, linkId/answer Structure, and JSON Template

How to structure an HL7 FHIR QuestionnaireResponse: required fields, linkId and answer[x] rules, qrs-1 nesting invariants, and a JSON template.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

The HL7 FHIR QuestionnaireResponse resource (QuestionnaireResponse) is the standardized Fast Healthcare Interoperability Resources (FHIR) instance structure used to capture a completed or in-progress set of answers supplied by a patient, clinician, or caregiver in response to a structured form definition (HL7 FHIR Questionnaire). Across digital patient intake software, USCDI v3 Social Determinants of Health (SDOH) screenings, and clinical trial electronic Patient-Reported Outcomes (ePRO), QuestionnaireResponse provides a deterministic, auditable JSON payload linking every submitted answer back to its exact form prompt via linkId.

What Should Be Included in a FHIR QuestionnaireResponse?

Under the HL7 FHIR Release 4 specification (hl7.org/fhir/R4/questionnaireresponse.html) and the US Core QuestionnaireResponse Profile, a compliant QuestionnaireResponse payload includes both header metadata (who completed which form and when) and a recursive item[] tree containing the recorded answers:

Element Path Cardinality (R4 / US Core) Data Type Required Content & Validation Rules
status 1..1 / 1..1 code Mandatory lifecycle state: in-progress | completed | amended | entered-in-error | stopped.
questionnaire 0..1 / 1..1 (MS) canonical(Questionnaire) Versioned canonical URI of the source form definition (e.g., http://hl7.org/fhir/us/core/Questionnaire/prapare|6.1.0).
subject 0..1 / 1..1 (MS) Reference(Patient|...) Identifies the patient or research subject the answers describe (Patient/[id]).
authored 0..1 / 1..1 (MS) dateTime ISO 8601 timestamp (including time zone offset) when the answers were gathered and saved.
author & source 0..1 / 0..1 (MS) Reference(...) author identifies who recorded/typed the answers (e.g., Practitioner or Patient); source identifies who provided the information (e.g., Patient or RelatedPerson caregiver).
item[].linkId 1..1 / 1..1 string Mandatory pointer that must match the exact item.linkId string and structural hierarchy defined in the canonical Questionnaire.
item[].answer[].value[x] 0..* / 0..* Choice of 12 types Typed response value: valueBoolean, valueDecimal, valueInteger, valueDate, valueDateTime, valueTime, valueString, valueUri, valueAttachment, valueCoding, valueQuantity, or valueReference.

How Is a FHIR QuestionnaireResponse Structured in EHR Workflows?

When implementing HIPAA-compliant intake forms or clinical screening flowsheets in an EHR, developers must enforce two core structural rules defined in the FHIR specification:

  1. Invariant qrs-1 (Mutually Exclusive Direct Child item vs. answer): The FHIR R4 invariant qrs-1 ((answer.exists() and item.exists()).not()) states that a QuestionnaireResponse.item cannot have both direct child item[] elements and direct answer[] elements at the same level.
    • If the item is a Section / Group (type = group in the Questionnaire), its children are placed directly in item.item[].
    • If the item is an Answered Question that has conditional sub-questions nested beneath that specific answer, the child sub-questions must be nested inside the answer object at item.answer[].item[].
  2. FHIRPath Extraction and Scoring: Downstream EHR engines and HL7 Structured Data Capture (SDC) pipelines use FHIRPath expressions (such as QuestionnaireResponse.repeat(item).where(linkId='q1').answer.valueCoding) to extract discrete LOINC/SNOMED CT observations and calculate total instrument scores.

Reusable FHIR R4 QuestionnaireResponse JSON Template

The production-ready JSON template below demonstrates a valid USCoreQuestionnaireResponseProfile payload containing a section group (item.item), coded LOINC/SNOMED answers (valueCoding), numeric answers (valueInteger), and a nested conditional sub-question placed inside answer[].item[] in compliance with invariant qrs-1:

{
  "resourceType": "QuestionnaireResponse",
  "id": "sdoh-and-pain-intake-response-001",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/core/StructureDefinition/us-core-questionnaireresponse"
    ]
  },
  "questionnaire": "http://example.org/fhir/Questionnaire/ambulatory-intake-v2",
  "status": "completed",
  "subject": {
    "reference": "Patient/example-patient-101",
    "display": "Elena Rostova"
  },
  "encounter": {
    "reference": "Encounter/ambulatory-visit-550"
  },
  "authored": "2026-11-09T15:20:00-05:00",
  "author": {
    "reference": "Patient/example-patient-101"
  },
  "source": {
    "reference": "Patient/example-patient-101"
  },
  "item": [
    {
      "linkId": "section-sdoh-screening",
      "text": "Social Determinants of Health (Hunger Vital Sign)",
      "item": [
        {
          "linkId": "loinc-88122-7",
          "text": "Within the past 12 months we worried whether our food would run out before we got money to buy more",
          "answer": [
            {
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA28397-0",
                "display": "Often true"
              }
            }
          ]
        }
      ]
    },
    {
      "linkId": "section-clinical-symptoms",
      "text": "Symptom Screening",
      "item": [
        {
          "linkId": "current-pain-present",
          "text": "Are you currently experiencing acute pain?",
          "answer": [
            {
              "valueBoolean": true,
              "item": [
                {
                  "linkId": "pain-severity-nrs",
                  "text": "Pain severity on a 0 to 10 numeric rating scale",
                  "answer": [
                    {
                      "valueInteger": 7
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Frequently Asked Questions

What should be included in a FHIR QuestionnaireResponse?

A compliant HL7 FHIR QuestionnaireResponse must include a lifecycle status (such as in-progress or completed), a canonical URI reference to the governing Questionnaire, the subject (Patient reference), the authored timestamp, author/source references, and a hierarchical item[] array where every item carries the exact linkId from the Questionnaire and stores typed answers inside answer[].value[x].

How is a FHIR QuestionnaireResponse structured in EHR workflows?

In EHR and US Core FHIR workflows, a QuestionnaireResponse mirrors the group and question nesting of its parent Questionnaire while obeying invariant qrs-1: group containers place child items in item.item[], whereas questions with conditional follow-ups nest their sub-questions inside item.answer[].item[] so Structured Data Capture ($extract) engines can convert answers into discrete FHIR Observation and Condition resources.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about FHIR QuestionnaireResponse Resource: Required Fields, linkId/answer Structure, and JSON Template

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →