View raw Markdown
type: sdc-pagesource: sdc/input/pagecontent/populate.xml

SDC: Form Population

One of the objectives of the SDC implementation guide is to reduce data entry into forms when the relevant data already exists in discrete form within the clinical or administrative system completing the form. This saves the user time and increases accuracy. If a Questionnaire is created with knowledge of where the data for different questions within the form is expected to come from, the Form Filler or Form Fill Manager system can query for the relevant information and automatically fill in some of the answers. FHIR's REST interface provides a standard way to query this data, regardless of the type of client.

This 'population' process can happen in one of two ways:

Population operations

The primary method of form pre-population is the $populate operation. It performs the population process and returns a QuestionnaireResponse, with relevant fields pre-filled based on the information provided or already known by the server.

Note: The $populate-html and $populate-link operations have been deprecated due to a lack of any known implementation in the entire time it's been present, and the adaptive questionnaires possibly having been used instead.

If using a populate operation, the operation will typically only be invoked once. However, there are two circumstances where it might be invoked more than once:

  1. If the user has saved a QuestionnaireResponse "in progress" and comes back to it later, it is possible they might choose to re-run the populate process, for example to load information they know has been entered or imported into the EHR since the last time the $populate process was run.
  2. If the user is creating a net new QuestionnaireResponse by copying a previous QuestionnaireResponse, the user might also want to re-run the population process to take advantage of new data that wasn't available in the original form.

Both of these situations involve starting from an existing QuestionnaireResponse, which means that "re-populating" a form is only relevant using $populate.

If choosing to re-populate a form, there are several considerations to keep in mind:

Population modes

There are three different modes of "population" possible:

"Choice selection" and "answer context" options will generally only be exposed when the user is interacting with the associated question (typically when a user clicks on an icon indicating they want to see the context or EHR choices).

Caveats and considerations with form population

Pre-population service

Populating a QuestionnaireResponse is a complex task. The system must be able to query resources, use FHIRPath or CQL to populate and potentially calculate relevant data elements, manage conditionality rules around enableWhen as part of the population process, etc. As a result, some client systems might prefer to offload the responsibility for handling pre-population of a form to a separate system. The FHIR specification defines a set of services that can be used to provide a variable degree of offloading - from just handling the population aspect through to handling the rendering of the form and interactive data capture completely through a separate site.

Operation

Description

populate

This operation supports generating a QuestionnaireResponse instance based on a specified Questionnaire. If matching data is available for any of the questions and the server supports the pre-population capability, the answers for those questions will be populated in the returned QuestionnaireResponse instance.

In addition to the $populate operation, another alternative is to use the Adaptive Form mechanism. It hides the design of the questionnaire entirely and, in principle, allows the service to determine the next question to automatically fill in (or perhaps even suppress asking questions) based on data the service can access about the patient.

For SDC purposes, server systems claiming to support CapabilityStatements that require support for the populate operation (SDC Form Manager) SHALL, at minimum:

Similarly, client systems claiming to support the populate operation (SDC Form Filler) SHALL, at a minimum:

* Supporting additional resources relevant to the context of the form is also encouraged. Past versions of this specification mandated support for passing C-CDA resources as FHIR Binary instances and this is still permitted. However, this specification no longer provides recommendations for extracting data elements from C-CDA and we have not yet heard of any systems that do this successfully in a production environment.

Designing Questionnaires to support 'populate'

This specification defines three different mechanisms to embed information in Questionnaires to support population:

Systems are free to experiment with other population mechanisms but cannot expect support for those from other SDC-conformant systems.

Each mechanism has its own profile that includes the additional resource elements or extensions relevant for supporting a particular mechanism: SDC Questionnaire Populate - Observation, SDC Questionnaire Populate - Expression, and SDC Questionnaire Populate - Structure Map profiles. Each profile identifies specific 'must support' elements and extensions that systems that claim to support a specific SDC population mechanism SHALL be capable of populating data, as befits the CapabilityStatement(s) they claim conformance to. Each system should choose which approach(es) it wishes to use and support based on the elements specified in that profile.

Some of these mechanisms make use of FHIR-based queries, FHIRPath and/or CQL as well as extensions that include expressions in one of these languages. Implementers should read the Using Expressions page for background and guidance on these technologies and extensions.

These three mechanisms aren't necessarily mutually exclusive. It is possible to use StructureMap-based population to perform an initial set of 'complex' population and then have different elements within the Questionnaire that are set up to perform supplemental observation-based or expression-based population. Obviously, the same element should only be populated in one way. Also, combining methods adds complexity and may reduce the number of systems that are capable of appropriately handling the Questionnaire.

Note: StructureMap-based population takes precedence over all other mechanisms. If a StructureMap is present, any observation-based or expression-based population expectations are ignored entirely. Observation-based and expression-based population may be performed simultaneously, item by item. However, if both approaches attempt to populate the same item, behavior is undefined. It is strongly recommended that Questionnaire authors avoid configuring both mechanisms to target the same question item. Systems may choose to raise an error, ignore one of the methods, or include both results in the case of repeating items.

Observation-based Population

Profile:

SDC Questionnaire Populate - Observation profile

Relevant Extensions:

Example Questionnaires:

USSG Family Health Template

This is the simplest of the population mechanisms. It takes advantage of the fact that most question answers in the healthcare space typically correspond to the value element of an Observation. It also takes advantage of the Questionnaire.item.code element that identifies what a concept each question or group corresponds to.

To use this method:

  1. Include the item.code element on each question to be populated. Typically, this will be a LOINC code, but in some jurisdictions/environments, SNOMED CT or other codes may be relevant.

  2. Groups can also have an item.code present - this might represent the code of a panel or the Observation.code of an Observation with no value but with multiple Observation.component elements. Child question items can then assert the item.code of the "member-of" Observations or the Observation.component.code values.

  3. To signal that the item.code is actually intended for use in population (as opposed to just providing metadata about the Questionnaire item, the observationLinkPeriod extension must also be included). This extension indicates the period of time over which to search for matching observations. If there are no observations within that window, no population will occur. For observations where how recent they are does not matter (e.g. blood type), simply set the duration to a long period of time - e.g. 200 years. If an observationLinkPeriod extension is defined at the root Questionnaire, on a group item (even if it has no item.code), or on a question item, that period applies to all descendant questions that have an item.code, unless a closer (i.e., nearer in the hierarchy) observationLinkPeriod is defined and overrides it.

    This means that placing the extension on a parent item enables auto-population behavior for all coded descendant items, using the specified period to determine which Observations to query. Items without item.code do not themselves get populated but pass the observationLinkPeriod to their coded children.

    Observation Link Period Hierarchical Diagram: This diagram illustrates the structure and flow of observationLinkPeriod extension in a Questionnaire. It shows how the period applies from the Questionnaire root down to group items and question items, with cases of inheritance, overriding, and items without codes.

    It shows how the period applies from the Questionnaire root down to group items and question items, with cases of inheritance, overriding, and items without codes

JSON

{% fragment Questionnaire/questionnaire-sdc-profile-example-weight-height-tracking-panel JSON BASE:descendants().select(item).where(linkId='/29463-7') %}

XML

{% fragment Questionnaire/questionnaire-sdc-profile-example-weight-height-tracking-panel XML BASE:descendants().select(item).where(linkId='/29463-7') %}

JSON

{% fragment Questionnaire/questionnaire-sdc-test-fhirpath-prepop-source-query JSON BASE:extension %}

XML

{% fragment Questionnaire/questionnaire-sdc-test-fhirpath-prepop-source-query XML BASE:extension %}