Observation-based extraction
Observation-based extraction is the simplest of the three extraction mechanisms
— it turns coded answers directly into Observation resources, with no mapping
setup required. This is the how-to; for the concept and how it compares to the
other mechanisms, see Extraction.
How it works
Two things make an item extractable:
- A code on the item (
item.code) — this becomes the Observation'scode. - The extraction flag turned on (
sdc-questionnaire-observationExtract). The flag is inherited down the tree: turning it on for a group opts in every coded question beneath it, and an explicit "off" on one child overrides that inherited "on" for just that item.
A question with several codes can also switch individual codes on or off: a code marked "on" produces an Observation carrying just that code (even if the question itself is not marked), and a code marked "off" is left out of the question's Observation.
The category of the extracted Observations (for example vital signs) comes from the
observation-extract-category setting on the questionnaire or an item; the nearest one
above an item wins. The builder does not edit this setting, but keeps it when a file is
imported and exported.
Every coded item with an answer produces one Observation (status: final).
Answers with a questionnaire-unit extension are written as a valueQuantity
with that unit; other answer types map to the matching value[x] (string,
boolean, integer, decimal, dateTime, Coding).
If a coded question sits inside a repeating group, every instance of the group gets
its own Observation (for example, three filled-in rows produce three
Observations).
Running it
- Fill in the form in the preview (or load a
QuestionnaireResponse). - Open Save ▾ → 🧪 Observations · FHIR JSON Bundle.
- A small dialog lets you optionally set the
subjectandauthorreferences and theQuestionnaireResponseid that each Observation should point back to. (The Observations are plain FHIRObservationresources; the specification defines no standard SDC profile to stamp on them.) - Confirm to download a transaction
Bundleof the extracted Observations.
Everything runs in the browser — no server is required.
When to use it vs. Definition-based extraction
Use Observation-based extraction when you simply want each coded answer to
become its own Observation — no setup beyond ticking the flag. Use
definition-based extraction when you need to populate specific fields of
specific resource types instead (e.g. build a Patient and a Condition). Both
are described in Extraction.
Next: Definition-based extraction.