Aidbox User Docs
Run Aidbox locallyRun Aidbox in SandboxTalk to us Ask community
  • Aidbox FHIR platform documentation
    • Features
    • Architecture
  • Getting Started
    • Run Aidbox in Sandbox
    • Run Aidbox locally
    • Run Aidbox on AWS
    • Upload Sample Data
  • Tutorials
    • CRUD, Search Tutorials
      • Delete data
      • Set up uniqueness in Resource
      • Search Tutorials
        • Custom SearchParameter tutorial
        • Create custom Aidbox Search resource
        • Multilingual search tutorial
        • Migrate from Aidbox SearchParameter to FHIR SearchParameter
        • Change sort order by locale collation
    • Bulk API Tutorials
      • 🎓Synthea by Bulk API
      • 🎓$dump-sql tutorial
    • Security & Access Control Tutorials
      • Allow patients to see their own data
      • Restrict operations on resource type
      • Relationship-based access control
      • Creating user & set up full user access
      • Restricting Access to Patient Data
      • Create and test access control
      • RBAC
        • Flexible RBAC built-in to Aidbox
        • RBAC with JWT containing role
        • RBAC with ACL
      • Set-up token introspection
      • Prohibit user to login
      • Debug access control
      • Managing Admin Access to the Aidbox UI Using Okta Groups
      • Run Multibox locally
      • How to enable labels-based access control
      • How to enable patient data access API
      • How to enable SMART on FHIR on Patient Access API
      • How to enable hierarchical access control
      • How to configure Audit Log
    • Terminology Tutorials
      • Load ICD-10 terminology into Aidbox
      • Uploading IG terminology content to external FHIR terminology server
    • Validation Tutorials
      • Upload FHIR Implementation Guide
        • Environment Variable
        • Aidbox UI
          • IG Package from Aidbox Registry
          • Public URL to IG Package
          • Local IG Package
        • Aidbox FHIR API
        • UploadFIG Tool
      • ISiK
      • Carin BB
      • US Core
      • Davinci Pdex
      • mCode
    • Integration Toolkit Tutorials
      • Postmark integration tutorial
      • Mailgun integration tutorial
    • Subscriptions Tutorials
      • AidboxTopicSubscription NATS tutorial
    • Other tutorials
      • Run Aidbox with FHIR R6
      • Migrate from Multibox to Aidbox
      • SDC with Custom Resources
      • How to create FHIR NPM package
      • Migrate from legacy licence portal to Aidbox portal
      • How to run Aidbox in GCP Cloud Run
  • Overview
    • Licensing and Support
    • Aidbox user portal
      • Projects
      • Licenses
      • Members
    • Aidbox UI
      • Aidbox Notebooks
      • REST Console
      • Database Console
      • Attrs stats
      • DB Tables
      • DB Queries
    • Versioning
    • Release Notes
    • Contact us
  • Configuration
    • Settings
    • Configure Aidbox and Multibox
    • Init Bundle
  • API
    • REST API
      • CRUD
        • Create
        • Read
        • Update
        • Patch
        • Delete
      • FHIR Search
        • SearchParameter
        • Include and Revinclude
        • Chaining
      • Aidbox Search
      • Bundle
      • History
      • $everything on Patient
      • Other
        • Aidbox & FHIR formats
        • Capability Statement
        • $document
        • Observation/$lastn
        • $validate
        • SQL endpoints
        • $matcho
        • $to-format
        • Aidbox version
        • Health check
    • Bulk API
      • Configure Access Policies for Bulk API
      • $dump
      • $dump-sql
      • $dump-csv
      • $export
      • $load & /fhir/$load
      • $import & /fhir/$import
      • aidbox.bulk data import
      • Bulk import from an S3 bucket
    • Batch/Transaction
    • GraphQL API
    • Other APIs
      • Plan API
        • Provider Directory API
          • Practitioner
          • PractitionerRole
          • Organization
          • OrganizationAffiliation
        • Plan API Overview
      • Archive/Restore API
        • create-archive
        • restore-archive
        • prune-archived-data
        • delete-archive
      • ETAG support
      • Cache
      • Changes API
      • RPC API
      • Sequence API
      • Encryption API
      • Batch Upsert
  • Modules
    • Profiling and validation
      • FHIR Schema Validator
        • Aidbox FHIR IGs Registry
        • Setup Aidbox with FHIR Schema validation engine
      • Skip validation of references in resource using request header
      • Asynchronous resource validation
    • Security & Access Control
      • Authentication Flows
        • Basic Auth
        • Client Credentials Grant
        • Resource Owner Grant
        • Authorization Code Grant
        • Implicit Grant
        • Two Factor Authentication
        • External OAuth 2.0 Providers
        • Token Exchange
      • External identity providers
        • Aidbox
        • Okta
        • Azure AD
        • Azure AD with certificate authentication
        • Keycloak
        • GitHub
        • Microsoft AD FS
        • Apple
      • Access Control
        • AccessPolicy
        • Evaluation engines
        • Role-Based Access Control (/RBAC)
        • Attribute-based Access Control (/ABAC)
        • Multitenancy
        • Access control lists (/ACL)
        • Access policy dev tool
        • AccessPolicy best practices
      • Audit
        • Audit Log
    • Observability
      • Getting started
        • Run Aidbox with OpenTelemetry locally
        • How to export telemetry to the OTEL collector
      • Logs
        • How-to guides
          • OpenTelemetry logs
          • Elastic Logs and Monitoring Integration
          • Datadog Log management integration
          • Loki Log management integration
        • Tutorials
          • Log analysis and visualization tutorial
          • Export logs to Datadog tutorial
        • Extending Aidbox Logs
        • Technical reference
          • Log appenders
          • Log transformations
          • Log Schema
          • OTEL logs exporter parameters
      • Metrics
        • How-to guides
          • How to export metrics to the OTEL collector
          • Use Aidbox Metrics Server
          • Set-up Grafana integration
        • Technical reference
          • OpenTelemetry Metrics
          • OTEL metrics exporter parameters
      • Traces
        • How to use tracing
        • OTEL traces exporter parameters
    • Subscriptions
      • Aidbox topic-based subscriptions
        • Kafka AidboxTopicDestination
        • Webhook AidboxTopicDestination
        • GCP Pub/Sub AidboxTopicDestination
        • Tutorial: produce QuestionnaireResponse to Kafka topic
      • Aidbox SubSubscriptions
    • Aidbox Forms
      • Getting started
      • Aidbox Forms Interface
      • Aidbox UI Builder
        • UI Builder Interface
        • Form creation
          • Form Settings
          • Widgets
          • Components
          • Versioning
          • Form customisation in Theme Editor
          • Form signature
          • How-to guides
            • How to: populate forms with data
            • How to extract data from forms
            • How to calculate form filling percentage
          • Multilingual forms
          • FHIRPath Editor
        • Import Questionnaire
        • Form sharing
        • Printing forms
          • Template-based PDF generation
        • FHIR versions
        • Offline forms
        • Embedding
          • Request Interception
        • Configuration
        • Forms multitenancy
        • Building reports using SQL on FHIR
        • Integration with external terminology servers
        • External FHIR servers as a data backend
        • Store attachments in S3-like storages
      • Access Control in Forms
      • Audit Logging in Forms
      • Aidbox Form Gallery
    • Define extensions
      • Extensions using StructureDefinition
      • Extensions using FHIRSchema
    • Custom Resources
      • Custom resources using FHIR Schema
      • Custom resources using StructureDefinition
      • Migrate to FHIR Schema
        • Migrate custom resources defined with Entity & Attributes to FHIR Schema
        • Migrate custom resources defined with Zen to FHIR Schema
    • Aidbox terminology module
      • Concept
        • $translate-concepts
        • Handling hierarchies using ancestors
      • ValueSet
        • ValueSet Expansion
        • ValueSet Code Validation
        • Create a ValueSet
      • CodeSystem
        • CodeSystem Concept Lookup
        • CodeSystem Subsumption testing
        • CodeSystem Code Composition
      • Import external terminologies
        • Import flat file (/CSV)
        • $import operation
        • Ready-to-use terminologies
      • $translate on ConceptMap
    • SQL on FHIR
      • Defining flat views with View Definitions
      • Query data from flat views
      • Reference
    • Integration toolkit
      • C-CDA / FHIR Converter
        • List of supported templates
          • Admission Diagnosis Section (/V3)
          • Advance Directives Section (/entries optional) (/V3)
          • Advance Directives Section (/entries required) (/V3)
          • Allergies and Intolerances Section (/entries optional) (/V3)
          • Allergies and Intolerances Section (/entries required) (/V3)
          • Assessment Section
          • Chief Complaint Section
          • Chief Complaint and Reason for Visit Section
          • Complications Section (/V3)
          • Course of Care Section
          • DICOM Object Catalog Section - DCM 121181
          • Default Section Rules
          • Discharge Diagnosis Section (/V3)
          • Document Header
          • Encounters Section (/entries optional) (/V3)
          • Encounters Section (/entries required) (/V3)
          • Family History Section (/V3)
          • Functional Status Section (/V2)
          • General Status Section
          • Goals Section
          • Health Concerns Section (/V2)
          • History of Present Illness Section
          • Hospital Consultations Section
          • Hospital Course Section
          • Hospital Discharge Instructions Section
          • Hospital Discharge Physical Section
          • Hospital Discharge Studies Summary Section
          • Immunizations Section (/entries optional) (/V3)
          • Immunizations Section (/entries required) (/V3)
          • Medical (/General) History Section
          • Medical Equipment Section (/V2)
          • Medications Administered Section (/V2)
          • Medications Section (/entries optional) (/V2)
          • Medications Section (/entries required) (/V2)
          • Mental Status Section (/V2)
          • Notes
          • Nutrition Section
          • Objective Section
          • Operative Note Fluids Section
          • Operative Note Surgical Procedure Section
          • Past Medical History (/V3)
          • Payers Section (/V3)
          • Plan of Treatment Section (/V2)
          • Postprocedure Diagnosis Section (/V3)
          • Preoperative Diagnosis Section (/V3)
          • Problem Section (/entries optional) (/V3)
          • Problem Section (/entries required) (/V3)
          • Procedure Description Section
          • Procedure Disposition Section
          • Procedure Estimated Blood Loss Section
          • Procedure Implants Section
          • Procedure Specimens Taken Section
          • Procedures Section (/entries optional) (/V2)
          • Procedures Section (/entries required) (/V2)
          • Reason for Visit Section
          • Results Section (/entries optional) (/V3)
          • Results Section (/entries required) (/V3)
          • Review of Systems Section
          • Social History Section (/V3)
          • Vital Signs Section (/entries optional) (/V3)
          • Vital Signs Section (/entries required) (/V3)
        • How to deploy the service
        • Producing C-CDA documents
        • How to customize conversion rules
      • HL7 v2 Integration
        • HL7 v2 integration with Aidbox Project
        • Mappings with lisp/mapping
      • X12 message converter
      • Analytics
        • Power BI
      • Mappings
      • Email Providers integration
        • Setup SMTP provider
    • SMARTbox | FHIR API for EHRs
      • Get started
        • Set up Smartbox locally
        • Deploy Smartbox with Kubernetes
      • (/g)(/10) Standardized API for patient and population services
      • The B11 Decision Support Interventions
        • Source attributes
        • Feedback Sections
      • How-to guides
        • Pass Inferno tests with Smartbox
        • Perform EHR launch
        • Pass Inferno Visual Inspection and Attestation
        • Revoke granted access
        • Set up EHR-level customization
        • Check email templates
        • Setup email provider
        • Register users
        • Set up SSO with Auth0
        • Publish Terms of Use link onto the documentation page
        • Find out what resources were exported during the $export operation
        • Find documentation endpoint
      • Background information
        • Considerations for Testing with Inferno ONC
        • Adding Clients for Inferno tests
        • Multitenancy approach
        • What is Tenant
        • Email templating
    • ePrescription
      • Getting started
      • Authentication with mTLS
      • Pharmacies synchronization
      • Prescribing
        • NewRx Message
        • CancelRx Message
        • How to test Callback
      • Directory
        • DirectoryDownload Message
        • GetProviderLocation Message
        • AddProviderLocation Message
        • UpdateProviderLocation Message
        • DisableProviderLocation Message
      • Medications
        • FDB
      • References
        • Environment Variables
      • Frequently Asked Questions
    • Other modules
      • MDM
        • Train model
        • Configure MDM module
        • Find duplicates: $match
        • Mathematical details
      • MCP
  • Database
    • Overview
    • Database schema
    • PostgreSQL Extensions
    • AidboxDB
      • HA AidboxDB
    • Tutorials
      • Migrate to AidboxDB 16
      • Working with pgAgent
  • File storage
    • AWS S3
    • GCP Cloud Storage
    • Azure Blob Storage
    • Oracle Cloud Storage
  • Deployment and maintenance
    • Deploy Aidbox
      • Run Aidbox on Kubernetes
        • Deploy Production-ready Aidbox to Kubernetes
        • Deploy Aidbox with Helm Charts
        • Highly Available Aidbox
        • Self-signed SSL certificates
      • Run Aidbox on managed PostgreSQL
      • How to inject env variables into Init Bundle
    • Backup and Restore
      • Crunchy Operator (/pgBackRest)
      • pg_dump
      • pg_basebackup
      • WAL-G
    • Indexes
      • Get suggested indexes
      • Create indexes manually
  • App development
    • Use Aidbox with React
    • Aidbox SDK
      • Aidbox JavaScript SDK
      • Apps
      • NodeJs SDK
      • Python SDK
    • Examples
  • Reference
    • FHIR Schema reference
    • Settings reference
      • General
      • FHIR
      • Security & Access Control
      • Modules
      • Database
      • Web Server
      • Observability
      • Zen Project
    • Environment variables
      • Aidbox required environment variables
      • Optional environment variables
      • AidboxDB environment variables
    • System resources reference
      • IAM Module Resources
      • SDC Module Resources
      • Base Module Resources
      • Bulk Module Resources
      • AWF Module Resources
      • Cloud Module Resources
      • HL7v2 Module Resources
      • SQL on FHIR Module Resources
    • Email Providers reference
      • Notification resource reference
      • Mailgun environment variables
      • Postmark environment variables
    • Aidbox Forms reference
      • FHIR SDC API
      • Aidbox SDC API
      • Generating Questionnaire from PDF API
    • Aidbox SQL functions
  • Deprecated
    • Deprecated
      • Zen-related
        • RPC reference
          • aidbox
            • mdm
              • aidbox.mdm/update-mdm-tables
              • aidbox.mdm/match
        • FTR
        • Aidbox configuration project
          • Run Aidbox locally using Aidbox Configuraiton project
          • Aidbox configuration project structure
          • Set up and use configuration projects
          • Enable IGs
          • Repository
          • Seed Import
          • Manage Indexes in Zen Project
          • Seed v2
          • 🎓Migrate to git Aidbox Configuration Projects
          • Aidbox Configuration project reference
            • Zen Configuration
            • Aidbox project RPC reference
            • aidbox.config/config
          • Custom resources using Aidbox Project
          • First-Class Extensions using Zen
          • Zen Indexes
        • US Core IG
          • US Core IG support reference
        • Workflow Engine
          • Task
            • Aidbox Built-in Tasks
            • Task Executor API
            • Task User API
          • Workflow
            • Workflow User API
          • Services
          • Monitoring
        • FHIR conformance Deprecated guides
          • Touchstone FHIR 4.0.1 basic server
          • Touchstone FHIR USCore ClinData
          • How to enable US Core IG
            • Start Aidbox locally with US Core IG enabled
            • Add US Core IG to a running Aidbox instance
          • HL7 FHIR Da Vinci PDex Plan Net IG
        • Terminology Deprecated Tutorials
          • Inferno Test-Suite US Core 3.1.1
        • API constructor (/beta)
        • zen-lang validator
          • Write a custom zen profile
          • Load zen profiles into Aidbox
        • FHIR topic-based subscriptions
          • Set up SubscriptionTopic
          • Tutorial: Subscribe to Topic (/R4B)
          • API Reference
            • Subscription API
        • 🏗️FHIR Terminology Repository
          • FTR Specification
          • Create an FTR instance
            • FTR from CSV
            • FTR from FHIR IG
            • FTR from FTR — Direct Dependency
            • FTR from FTR — Supplement
          • FTR Manifest
          • Load SNOMED CT into Aidbox
          • Load LOINC into Aidbox
          • Load ICD-10-CM into Aidbox
          • Load RxNorm into Aidbox
          • Load US VSAC Package to Aidbox
          • Import via FTR
        • Zen Search Parameters
      • Entity / Attribute
        • Entities & Attributes
        • First-Class Extensions using Attribute
        • Custom Resources using Entity
        • Working with Extensions
        • Aidbox Search Parameters
      • Forms
      • Other
        • Custom Search
        • SearchQuery
        • Subscribe to new Patient resource
        • App Development Deprecated Tutorials
          • Receive logs from your app
            • X-Audit header
          • Patient Encounter notification Application
        • Other Deprecated Tutorials
          • Resource generation with map-to-fhir-bundle-task and subscription triggers
          • APM Aidbox
          • Automatically archive AuditEvent resources in GCP storage guide
          • HL7 v2 pipeline with Patient mapping
          • How to migrate to Apline Linux
          • How to migrate transaction id to bigint
          • How to fix broken dates
          • Configure multi-tenancy
        • AidboxProfile
        • GCP Pub/Sub
Powered by GitBook
On this page
  • FHIR SDC API
  • Populate Questionnaire - $populate
  • URLs
  • Parameters
  • Response
  • Usage Example
  • Populate Questionnaire and generate a link - $populatelink
  • URLs
  • Parameters
  • Response
  • Usage Example
  • Questionnaire response extract to resources - $extract
  • URLs
  • Parameters
  • Response
  • Usage Example
  • ValueSet Expansion - $expand

Was this helpful?

Edit on GitHub
  1. Reference
  2. Aidbox Forms reference

FHIR SDC API

This article outlines operations from the FHIR SDC Implementation Guide.

PreviousAidbox Forms referenceNextAidbox SDC API

Last updated 7 days ago

Was this helpful?

Implementation corresponds to

FHIR SDC API

Aidbox Forms module supports FHIR SDC operations:

  • - filling out a form with existing data ()

  • - filling out a form with existing data, and return signed link to it ()

  • - extract data from QuestionnaireResponse to other FHIR resources ()

  • - create a simple collection of codes suitable for use for data entry or validation. ()

We have created an demonstrating different population and extraction methods:

Populate Questionnaire - $populate

The operation generates a based on a specific , filling in answers to questions where possible based on information provided as part of the operation or already known by the server about the subject of the Questionnaire.

This implementation supports the and population methods.

URLs

POST [base]/fhir/Questionnaire/$populate
POST [base]/fhir/Questionnaire/[id]/$populate

Parameters

Parameter
Cardinality
Type
Status

0..1

supported

0..1

supported

0..1

supported

0..1

supported

1..1

supported

0..*

supported

1..1

supported

1..*

supported

0..1

supported

0..1

not supported

Example

resourceType: Parameters
parameter:
- name: subject
  valueReference:
    reference: Patient/pt-1

identifier

A logical questionnaire identifier (i.e. Questionnaire.identifier). The server must know the questionnaire or be able to retrieve it from other known repositories.

name: identifier
valueIdentifier:
  system: 'forms.aidbox'
  value: 'vitals'

canonical

The canonical identifier for the questionnaire (optionally version-specific).

name: canonical
valueCanonical: http://forms.aidbox.io/Questionnaire/vitals

questionnaire

The Questionnaire is provided directly as part of the request. Servers may choose not to accept questionnaires in this fashion

name: questionnaire
resource:
  resourceType: Questionnaire
  id: new-form
  title: "Vitals"
  ...

questionnaireRef

The Questionnaire is provided as a resource reference. Servers may choose not to accept questionnaires in this fashion or may fail if they cannot resolve or access the referenced questionnaire.

name: questionnaireRef
valueReference:
  resourceType: Questionnaire
  id: new-form

subject

The resource that is to be the QuestionnaireResponse.subject. The QuestionnaireResponse instance will reference the provided subject. In addition, if the local parameter is set to true, server information about the specified subject will be used to populate the instance.

name: subject
valueReference:
  reference: Patient/pt-1

local

If specified and set to true (and the server is capable), the server should use what resources and other knowledge it has about the referenced subject when pre-populating answers to questions.

name: local
valueBoolean: true

context

Resources containing information to be used to help populate the QuestionnaireResponse. These will typically be FHIR resources.

Context paramertes are presented as pairs of name and content parameters that are placed under the part key.

They should correspond launchContext parameter definitions.

name: context
part:
- name: name
  valueString: encounter
- name: content
  valueReference:
    reference: Encounter/enc1
Code
Type
Definition

patient

Patient Patient in context at launch time

encounter

Encounter context at launch time

location

Location context at launch time

user

User in context at launch time

study

ResearchStudy in context at launch time

WARN: This is non FHIR SDC compliant behavior!

Code
Type

identifier

basedOn

partOf

encounter

author

source

Example:

name: name
valueReference:
  reference: ServiceRequest/sr1

context.name

The name of the launchContext or root Questionnaire variable the passed content should be used as for population purposes. The name SHALL correspond to a launchContext or variable delared at the root of the Questionnaire.

name: name
valueString: encounter

context.content

The actual resource (or resources) to use as the value of the launchContext or variable.

name: content
valueReference:
  reference: Encounter/enc1

Or

name: content
resource:
  ...
  resourceType: Encounter
  id: enc1
  subject:
    reference: Patient/pt-1
  ...

launchContext

Resources that provide context for form processing logic (pre-population) when creating/displaying/editing a QuestionnaireResponse.

Response

Success response shape

Parameter
Cardinality
Type
Description

response

1..1

The partially (or fully)-populated set of answers for the specified Questionnaire

issues

0..1

A list of hints and warnings about problems encountered while populating the questionnaire.

Usage Example

POST [base]/fhir/Questionnaire/vitals/$populate
content-type: text/yaml

resourceType: Parameters
parameter:
- name: subject
  valueReference:
    reference: Patient/pt-1
- name: context
  part:
  - name: name
    valueString: encounter
  - name: content
    valueReference:
      reference: Encounter/enc1

HTTP status: 200

resourceType: Parameters
parameter:
- name: response
  resource:
    resourceType: QuestionnaireResponse
    questionnaire: http://aidbox.app/forms/new-form
    status: in-progress
    basedOn:
      reference: ServiceRequest/sr1
    encounter:
      reference: Encounter/enc1
    item:
    - linkId: name
      text: Name
    - linkId: weight

HTTP status: 422

resourceType: OperationOutcome
text:
  status: generated
  div: Parameters are invalid
issue:
- severity: error
  code: invalid
  expression:
  - parameter.0.resource
  diagnostics: unknown key :resource

Populate Questionnaire and generate a link - $populatelink

URLs

POST [base]/fhir/Questionnaire/$populatelink
POST [base]/fhir/Questionnaire/[id]/$populatelink

Parameters

WARN: The following parameters are not FHIR SDC compliant. This is an extension of the specification.

NOTE: Don't forget to wrap parameters in Parameters object

resourceType: Parameters
parameter:
- name:  [var-name]
  valueX: [varType: var-value]
Parameter
Cardinality
Type

0..1

0..1

0..1

0..1

0..1

0..1

0..1

0..1

0..1

allow-amend

Whether the generated link will allow amending and re-submitting the form.

name: allow-amend
valueBoolean: true

allow-repopulate

Whether the generated link will allow re-populating the form.

NOTE: Repopulate will be working only with forms that contain populate behavior

name: allow-repopulate
valueBoolean: true

redirect-on-submit

A URL where the user will be redirected to after successfully submitting the form.

name: redirect-on-submit
valueString: https://example.com/submit-hook?questionnaire=123

redirect-on-save

A URL where the user will be redirected to after hitting Save button.

By default Save button is not visible - form autosaved after every keystroke. But sometimes it's usefull to close form in a partially-filled state

name: redirect-on-save
valueString: https://example.com/submit-hook?questionnaire=123

link expiration time

Link expiration period (days)

name: expiration
valueInteger: 30

By default thir parameter = 7 days

theme

Form theme. QuestionnaireTheme resource id.

name: theme
valueString: hs-theme

config

Form config. SDCConfig resource id.

name: theme
valueString: default-config

read-only

Open form in read-only mode.

name: read-only
valueBoolean: true

app-name

Application name that will be used in Audit logging when returned link was used.

Audit logging should be enabled.

name: app-name
valueString: my-app

Response

Parameter
Cardinality
Type
Description

link

1..1

The URL for the web form that supports capturing the information defined by questionnaire

issues

0..1

A list of hints and warnings about problems encountered while populating the questionnaire

Usage Example

POST [base]/fhir/Questionnaire/vitals/$populatelink
content-type: text/yaml

resourceType: Parameters
parameter:
- name: subject
  valueReference:
    reference: Patient/pt-1
- name: context
  part:
  - name: name
    valueString: encounter
  - name: content
    resource:
      resourceType: Encounter
      id: enc-1
      subject:
        reference: Patient/pt-1

HTTP status: 200

resourceType: Parameters
parameter:
- name: link
  valueUri: http://forms.aidbox.io/ui/sdc#/questionnaire-response/12c1178c-70a9-4e02-a53d-65b13373926e?token=eyJhbGciOiJIUzI

HTTP status: 422

resourceType: OperationOutcome
text:
  status: generated
  div: Parameters are invalid
issue:
- severity: error
  code: invalid
  expression:
  - parameter.0.resource
  diagnostics: unknown key :resource

Questionnaire response extract to resources - $extract

Current Logic for Observation-based extraction:

  • A new Observation is created for each Questionnaire Response instance at the time of data extraction.

  • If a QR is amended (modified after submission), the existing Observations linked to that QR are updated accordingly.

Current Logic for Definition-based extraction:

  • Two Options for Resource Extraction:

    • New Resource: If "new resource" is selected, a new resource is always created during extraction.

    • Existing Resource: If "existing resource" is selected, the system includes the questionnaire-itemExtractionContext extension. This extension can be added either at the root of the Questionnaire or at any item level. It identifies the resource that serves as the context for extraction.

Using itemExtractionContext:

  • Empty itemExtractionContext: When the itemExtractionContext is empty, the Questionnaire is used to create a new resource.

  • Populated itemExtractionContext: If the itemExtractionContext contains a resource (or set of resources), the Questionnaire updates the existing resource.

URLs

URL: [base]/fhir/QuestionnaireResponse/$extract
URL: [base]/fhir/QuestionnaireResponse/[id]/$extract

Parameters

Parameter
Cardinality
Type
Description

questionnaire-response

0..1

The QuestionnaireResponse to extract data from.

Example

resourceType: Parameters
parameter:
- name: questionnaire-response
  resource:
    id: qr-1
    resourceType: QuestionnaireResponse
    ...

Response

Parameter
Cardinality
Type
Description

return

1..1

FHIR Bundle with extracted resources

issues

0..1

A list of hints and warnings about problems encountered while extracting the data

Usage Example

POST [base]/fhir/QuestionnaireResponse/$extract
content-type: text/yaml

resourceType: Parameters
parameter:
- name: questionnaire-response
  resource:
    id: pt-1
    resourceType: QuestionnaireResponse
    questionnaire: https://forms.aidbox.io/vitals
    item:
      - linkId: temperature
        valueDecimal: 36.6
    ...

HTTP status: 200

return:
  resourceType: Bundle
  type: transaction
  entry:
  - resource:
      resourceType: Observation
      status: final
      code:
        coding:
        - code: body-temperature
          system: loinc
      subject:
        reference: Patient/pt-1
      valueQuantity:
        unit: [c]
        value: 36.6
    request: {method: POST,  url: /Observation}

HTTP status: 422

resourceType: OperationOutcome
text:
  status: generated
  div: Parameters are invalid
issue:
- severity: error
  code: invalid
  expression:
  - parameter.0.resource.given
  diagnostics: unknown key :given

ValueSet Expansion - $expand

Value Sets are used to define possible coded answer choices in a questionnaire.

The use of standardized codes is useful when data needs to be populated into the questionnaire or extracted from the questionnaire for other uses.

The expand operation expand given ValueSet in to set of concepts.

Parameters are specified via FHIR type.

FHIR SDC launchContext extension possible context variables, they are:

/resource

/resource

/resource

/resource

/resource

Additionnaly Aidbox expands this list with parameters that mirrors root properties.

Paramerters passed directly to root properties and should not be used in populate expressions.

in failure case - response is specified as object.

in success case - response is specified as object.

The operation generates a link to a web page to be used to answer a specified . The form at the specified location will be pre-filled with answers to questions where possible based on information provided as part of the operation or already known by the server about the subject of the Questionnaire.

The base set of parameters is the same as for . On top of that, a few extra parameters are supported by Aidbox Forms.

in failure case - response is specified as object containing a link.

in success case - response is specified as object containing a list of issues.

The operation takes a completed QuestionnaireResponse and extracts it's data to Bundle of resources by using metadata embedded in the Questionnaire the QuestionnaireResponse is based on. The extracted resources might include Observations, MedicationStatements and other standard FHIR resources which can then be shared and manipulated.

Aidbox supports only the and extraction methods.

In the future, Aidbox Forms will align with the implementation described in the .

Parameters are specified via FHIR type.

in failure case - response is specified as object.

in success case - response is specified as object.

This operation is described in detail .

Parameters
enumerates
QuestionnaireResponse
QuestionnaireResponse
OperationOutcome
Parameters
populatelink
Questionnaire
OperationOutcome
Parameters
extract
Observation based
Definition based
FHIR Structured Data Capture (SDC) specification
Parameters
OperationOutcome
Parameters
here
SDC FHIR IG - 3.0.version 0
FHIR
FHIR
FHIR
FHIR
Aidbox notebook
Aidbox forms: populate & extract
populate
QuestionnaireResponse
Questionnaire
Observation based
Expression based
$populate
$populatelink
$extract
$expand
$populate
Identifier
uri
Questionnaire
Reference
Reference
Reference
string
Reference
boolean
Extension
Reference
Reference
Reference
Reference<Patient, Device, PractitionerRole, Practitioner, RelatedPerson, Organization>
Reference
Identifier
Reference<CarePlan, ServiceRequest>
Reference<Observation, Procedure>
Reference<CarePlan/ServiceRequest>
Reference<Device, Practitioner, PractitionerRole, Patient, RelatedPerson, Organization>
Reference<Device, Organization, Patient, Practitioner, PractitionerRole, RelatedPerson>
QuestionnaireResponse
OperationOutcome
Boolean
Boolean
String
String
Integer
String
String
Boolean
String
uri
OperationOutcome
Resourse
Resourse
OperationOutcome
identifier
canonical
questionnaire
questionnaireRef
subject
context
context.name
context.content
local
launchContext
allow-amend
allow-repopulate
redirect-on-submit
redirect-on-submit
expiration
theme
config
read-only
app-name