The visible questions in a prior authorization form depend on earlier answers, EHR data, and payer-authored logic. A form that opens and saves is not necessarily asking the right things. HL7 Da Vinci DTR v2.2.0 requires standard and adaptive Questionnaires to include only questions and answer choices needed for the intended purpose, based on information already supplied. Implementers therefore need to test the form as a changing decision path, not just as a static list of fields.
Map every dependency before rendering
Start with the Questionnaire and its Library dependencies in the package. For each item, record its linkId, answer type, required flag, answer set, and the answers or expressions that govern whether it is enabled. FHIR R4 Questionnaire provides enableWhen for comparisons against another question and enableBehavior for how multiple conditions combine. The DTR guide also allows expression-based behavior and identifies the elements and extensions its clients must support.
A useful review table connects each conditional item to the source question or expression and the expected visible state. Include a case where the controlling answer is absent, one where it changes, and one where multiple conditions disagree. If the form mixes clinical and administrative questions, DTR describes separate forms or a clear handoff point after the clinical portion; the branching map should show who is expected to answer each part.
- Check that every condition points to the intended question and answer type.
- Test required fields only when their items are enabled.
- Show the intended user or role for questions that require clinical review.
Exercise CQL and prepopulation in order
DTR uses SDC expression-based population. The guide says Questionnaire expression logic for flow or rendering is written in CQL, while clients handle expressions denoted as CQL or FHIRPath. Libraries needed by a Questionnaire belong in the questionnaire package. For enabled items, the client attempts population before showing the draft response to the user. Test with a record that has the expected source data, a record with no matching data, and a record where two candidate facts could be confused.
Population can change whether another item is enabled; that new item may itself need population. DTR requires clients to iterate until the logic reaches a steady state. If dependencies cycle so that no steady state is possible, the Questionnaire is erroneous and automatic population must end with the user informed. Put a deliberate cycle in a nonproduction test fixture to verify that failure is visible rather than an endless spinner or a silently incomplete form.
- Verify the packaged Library and data requirements are available to the client.
- Compare the populated value with the source record and its date.
- Test a dependency chain and a nonconverging cycle.
Recalculate when the user changes an answer
A reviewer may correct an answer that was prepopulated or change an earlier response. DTR requires the client to monitor dependent answers and re-execute logic, adjusting calculated values, enabled items, and validation rules. Test a change in both directions: a follow-up question becomes relevant, then becomes irrelevant again. Confirm that the screen and saved QuestionnaireResponse agree about the current state, especially after a draft is reopened.
Keep a review step for values that came from the EHR or payer. The DTR information-origin extension distinguishes automatic population and user changes; another FHIRant article covers that provenance detail. The conditional-logic test here is whether an edited answer leads to the right downstream questions without hiding a newly required item or retaining a stale calculated answer as if it were current.
Validate the path a real user can complete
Run an end-to-end form session for each important branch, including a branch with no applicable follow-up questions. DTR requires ongoing QuestionnaireResponse validation and visual flags for elements needing correction. For standard forms, a valid response can be offered for user completion, but the client does not mark it complete automatically. Adaptive forms use a different completion path through the payer’s next-question operation.
Before release, compare the questions presented with the Questionnaire rules, the answers retained in the response, and the errors shown to the user. A good test report names the package version, the branch taken, the source facts used for population, and the final response status. That makes a payer form change reviewable without assuming every patient or order should follow the same path.
- Cover each high-impact branch with a complete draft-to-review scenario.
- Check that invalid answers point the user to the affected item.
- Record the form version and expected visible questions in regression cases.