A DTR form can change between discovery, launch, and a resumed session. Rendering only the question text from a cached copy risks pairing answers with the wrong rules or answer choices. HL7 Da Vinci DTR v2.2.0 defines a $questionnaire-package operation that returns the Questionnaire, an initial QuestionnaireResponse, and needed Library and ValueSet dependencies. This guide turns those requirements into retrieval, validation, and resume checks for an implementation team.

Send enough context to retrieve the intended forms

The package operation requires Coverage resources that identify the member and coverage type, plus at least one of three inputs: Questionnaire canonicals, a CRD or PAS context ID, or Request or Encounter resources. An explicit canonical can include a version; without one, the operation uses the current version. For context-based inputs, the payer determines which questionnaires apply. A client should retain the coverage, order, and context that produced the package so a reviewer can explain why a form appeared.

The operation can return more than one form, including distinct versions associated with different orders or coverages. Treat each returned QuestionnaireResponse context as part of the form assignment. A screen that merges identically titled forms across two coverages can erase which payer and order each answer belongs to. If CRD indicated documentation was needed but the package returns no forms, the operation calls for an OperationOutcome with instructions or an explanation that circumstances changed. Show that outcome to staff rather than an empty “nothing needed” screen.

  • Persist the exact Coverage and Request or Encounter context used for retrieval.
  • Keep each Questionnaire version tied to its associated order and coverage.
  • Route no-form and warning outcomes to a visible resolution path.

Keep the Questionnaire and its dependencies as one package

A successful operation returns output Parameters containing a separate collection Bundle for each Questionnaire. The Bundle begins with the Questionnaire and includes an initial draft QuestionnaireResponse. It also includes external Libraries and ValueSets needed to process the form. The operation specifies recursive retrieval of Library dependencies, and references to Questionnaires, Libraries, and ValueSets within the Bundle must be version specific because breaking changes can cause inconsistent processing.

Store the received package as the session’s rule and terminology snapshot. Resolve its references before rendering or calculating answers, and report missing dependencies instead of substituting a newer local Library or ValueSet with a similar name. The operation can include warnings when a dependency cannot be retrieved or a ValueSet cannot be expanded. A successful HTTP response with such a warning is not proof that the form can be completed as intended. For adaptive forms, the guide permits extra Libraries or ValueSets in the initial package; keep them in the session because later $next-question calls may need them.

Refresh deliberately when work resumes

DTR specifies that a client resuming a work-in-progress QuestionnaireResponse invokes $questionnaire-package with a timestamp to check whether the package has changed since retrieval, using QuestionnaireResponse.meta.lastUpdated as the presumed retrieval time. Keep that time and the returned canonical versions with the draft. When a package changes, identify the affected form and rules before carrying answers forward; do not silently re-label the old response as a response to the new version.

A practical review queue can compare Questionnaire URL and version, dependency versions, answer linkIds, and coverage or order context. If a changed form removes a question or changes its answer set, preserve the prior response for traceability and ask the appropriate user to review any migrated answers. This is an implementation safeguard rather than a claim that the DTR guide prescribes one universal answer-migration algorithm.

  • Save retrieval time, canonical versions, and source package with the draft.
  • Check for package changes on resume.
  • Require review when a changed package affects answer meaning or allowed values.

Make package failure and version drift testable

Test an explicit versioned canonical, an unversioned canonical, two coverages that require different versions of one Questionnaire, and a context ID with no returned form. Add a missing Library, an unexpanded ValueSet, and an adaptive form that uses an initially supplied dependency later in the session. Verify that the UI shows warnings, keeps forms distinct, and never renders a rule-dependent question from an unresolved dependency without a clear failure state.

Finally, save a draft, change the server’s package, and resume. The client should make the change visible, retain the original answers and package, and avoid sending a response under the wrong Questionnaire version. These checks make form completion reproducible and easier to troubleshoot when a payer updates requirements.

Primary references