Skip to main content

Global Questionnaire Information & Data Linking Standard

This document defines the architectural standard for handling Questionnaires and their corresponding Responses. To ensure data integrity and version persistence across different environments, all links must follow a Canonical Referencing pattern rather than relying on internal database IDs.


1. Questionnaire Identity & Versioning

A Questionnaire is identified by a combination of two specific fields that define its unique "schema identity":

  • URL (url): A globally unique URI (e.g., https://system-domain.com/Questionnaire/patient-intake).
    • Note: The URL identifies the "type" of form but is not unique on its own, as multiple versions may exist under the same URL.
  • Version (version): A user-defined String (e.g., "1.0.4", "2024-alpha", or "v2").

The Unique ID vs. Canonical URL

While every Questionnaire has a technical ID that is unique within its specific database instance, this ID is not used as the primary reference in a Response. This is because internal IDs can change during data migrations or environment syncs.

The "source of truth" for a link is the Canonical URL: Canonical Reference = [URL] + "|" + [Version]


2. Technical Logic Flows

The following flows describe the internal logic for synchronizing these resources. This process ensures that the correct Questionnaire and Response are paired before any data is processed or displayed.

Flow A: Resource Initialization (No Response exists)

  1. Select Questionnaire: The system identifies the target Questionnaire.
  2. Initialize Response: A QuestionnaireResponse is created programmatically.
  3. Establish Link: The Questionnaire’s url and version are written into the Response’s questionnaire reference field.
  4. Sync-Reload: The Questionnaire is re-loaded based on the reference stored in the Response. This step ensures that the system is operating on the exact versioned instance linked to the newly created data object.

Flow B: Resource Loading (Response already exists)

  1. Load Response: The system fetches the existing QuestionnaireResponse.
  2. Extract Canonical: The system parses the url and version from the Response’s reference field.
  3. Load Versioned Questionnaire: The system fetches the specific Questionnaire that matches both the URL and the Version String.
  4. Resolution: The two resources are now correctly paired for rendering or data processing, ensuring the structure (Questionnaire) matches the data (Response).

3. Aidbox Tipps for Questionnaire Handling