Adaptive Exchange Replay

Recorded exchange · no operation is invoked · zero network

An adaptive DTR Questionnaire does not hand you its questions. The client calls $next-question and the payer decides what to ask next, per patient, per order. This walks a committed four-turn transcript so you can see the branch happen — and see why counting the items of an adaptive form is a question static analysis has to refuse.

Turn 1 of 4

Why these questions now: Nothing is known yet — the payer opens on qualification, not equipment.

Request — Parameters · questionnaire-response

{
  "resourceType": "Parameters",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-next-question-input-parameters"
    ]
  },
  "parameter": [
    {
      "name": "questionnaire-response",
      "resource": {
        "resourceType": "QuestionnaireResponse",
        "meta": {
          "profile": [
            "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaireresponse-adapt"
          ]
        },
        "contained": [
          {
            "resourceType": "Questionnaire",
            "id": "home-oxygen-adaptive",
            "meta": {
              "profile": [
                "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaire-adapt"
              ]
            },
            "url": "https://payer.example.org/fhir/Questionnaire/home-oxygen-adaptive",
            "version": "1.0.0",
            "name": "HomeOxygenTherapyAdaptive",
            "title": "Home Oxygen Therapy (adaptive)",
            "status": "active",
            "subjectType": [
              "Patient"
            ],
            "extension": [
              {
                "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-questionnaireAdaptive",
                "valueBoolean": true
              }
            ]
          }
        ],
        "questionnaire": "#home-oxygen-adaptive",
        "status": "in-progress",
        "subject": {
          "reference": "Patient/synthetic-adult-copd"
        }
      }
    }
  ]
}

Response — Parameters · return

{
  "resourceType": "Parameters",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-next-question-output-parameters"
    ]
  },
  "parameter": [
    {
      "name": "return",
      "resource": {
        "resourceType": "QuestionnaireResponse",
        "meta": {
          "profile": [
            "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaireresponse-adapt"
          ]
        },
        "contained": [
          {
            "resourceType": "Questionnaire",
            "id": "home-oxygen-adaptive",
            "meta": {
              "profile": [
                "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaire-adapt"
              ]
            },
            "url": "https://payer.example.org/fhir/Questionnaire/home-oxygen-adaptive",
            "version": "1.0.0",
            "name": "HomeOxygenTherapyAdaptive",
            "title": "Home Oxygen Therapy (adaptive)",
            "status": "active",
            "subjectType": [
              "Patient"
            ],
            "extension": [
              {
                "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-questionnaireAdaptive",
                "valueBoolean": true
              }
            ],
            "item": [
              {
                "linkId": "q-diagnosis",
                "text": "Which qualifying diagnosis supports this request?",
                "type": "choice",
                "required": true,
                "answerValueSet": "https://payer.example.org/fhir/ValueSet/copd-diagnoses"
              },
              {
                "linkId": "q-on-oxygen",
                "text": "Is the patient currently receiving supplemental oxygen at home?",
                "type": "boolean",
                "required": true
              }
            ]
          }
        ],
        "questionnaire": "#home-oxygen-adaptive",
        "status": "in-progress",
        "subject": {
          "reference": "Patient/synthetic-adult-copd"
        }
      }
    }
  ]
}

Questions asked so far (2)

The set only ever grows. Items already seen are muted; items new to this turn are highlighted — that accumulation is what a static item tree cannot show you.

  • q-diagnosis · choice · requiredWhich qualifying diagnosis supports this request? · new this turn
  • q-on-oxygen · boolean · requiredIs the patient currently receiving supplemental oxygen at home? · new this turn

The shape of the exchange

Each direction is a Parameters carrying exactly one parameter — questionnaire-response going out, return coming back — and both hold a QuestionnaireResponse with the accumulated Questionnaire contained inside it, referenced as a # fragment. The questions therefore live two hops down, not on the response root. That containment direction is the detail worth taking from this replay: the form travels inside the answers, which is what lets a single resource carry the whole conversation so far.

Why static analysis refuses to count this form

The contained Questionnaire above is https://payer.example.org/fhir/Questionnaire/home-oxygen-adaptive — the same resource the workbench reports as REFUSED rather than reporting zero questions. Both statements are true at once: the payload declares no items, and a payer would have served nine across four turns. That is the gap a number would have hidden. Load it in the workbench to see the refusal itself.

Authored synthetic transcript. No operation was invoked, no payer was contacted, and no network request produced any file here. The next question in each turn was written, not computed.