Da Vinci Clinical Data Exchange (CDex)
2.1.0 - STU 2.1

Da Vinci Clinical Data Exchange (CDex), published by HL7 International / Payer/Provider Information Exchange Work Group. This guide is not an authorized publication; it is the continuous build for version 2.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/davinci-ecdx/ and changes regularly. See the Directory of published versions

## Requesting Attachments Using Questionnaires

Page standards status: Trial-use

This page documents an optional solicited attachments transaction for requesting additional claims or prior authorization data from a Provider using FHIR Questionnaire.* The Payer uses the Task-based CDex Task Attachment Request Profile to request a Provider to complete one or more questionnaires. The Provider launches Da Vinci DTR to complete the questionnaires and, as documented in the Sending Attachments page, submits the completed questionnaires to the Payer using the `$submit-attachment` operation. In contrast to Requesting Attachments Using Attachment Codes, a HIPAA-based request model using attachment codes, it supports using FHIR Questionnaire to define in more detail what data is missing. As a result, it avoids unnecessary documents. In addition, it leverages Da Vinci DTR functionality to fill out the FHIR Questionnaire, reducing the time spent reviewing documentation requirements.

* See the Conforming to CDex Attachments page for how systems declare what they support for the various actors and roles in CDex Attachments.

### Requesting Attachments Using FHIR

Payers can request attachments and additional data for claims and prior authorizations as a FHIR transaction. CDex uses Task to represent both the data request and the returned data and provides information such as why it needs to be completed, who is to complete it, who is asking for it, when it is due, etc. The Provider updates the Task’s status as the task is fulfilled.

The Task Based Approach page documents the general approach to using Task to request data. For requesting attachments using CDex Attachments, review the following sections on the Task Based Approach page:

- Benefits
- Task Inputs and Outputs
- Purpose of Use
- Task Reason
- Discovery of Identifiers
- Task State Machine
- Using Questionnaire as Task Input

In the more general CDEX Task Based Approach, the Data Consumer polls or subscribes to Task status updates and pulls the data when the Task is complete. In contrast, for CDEX Attachments, The Provider pushes the data to the Payer-supplied endpoint using the `$submit-attachment` operation, as documented on the Sending Attachments page.

#### CDex Attachment Request Profile

For CDex attachment requests transactions, the Payer SHALL use the CDex Task Attachment Request Profile to solicit information from a Provider. For a detailed description of all the mandatory, must support, and optional elements, as well as formal definitions and profile views, see the CDex Task Data Request Profile page.

### Requesting Attachments Using FHIR Questionnaires

In contrast to Requesting Attachments Using Attachment Codes, when a Payer references one or more FHIR Questionnaires as input parameters, the Task represents a request for the Provider to complete the questionnaires. The CDex Task Attachment Request Profile defines a specific `Task.code` that directs the Provider to launch a [Da Vinci - Documentation Templates and Rules (DTR)] application to use the Payer provided Questionnaires and results from any CQL execution to generate and complete a QuestionnaireResponse. Figure 17 below summarizes the steps for requesting and completing a questionnaire using CDex Attachments and DTR, and the sequence diagram in the following section illustrates these transactions in more detail:

Figure 17

Step 1: The Payer POSTs a Task to the Provider. The Task is a request to complete a questionnaire.

Step 2: If the `Task.code` is "attachment-request-questionnaire", the Provider launches DTR and shares the Task as a launch parameter (i.e., DTR has access to read and update the Task and access to other resources to complete the QuestionnaireResponse in Step 3)

Step 3: DTR fetches the Task, which contains the link to the Questionnaire. Then, it fetches the Questionnaire (and any CQL rules defined within it) and completes the QuestionnaireResponse. Refer to the Da Vinci DTR Implementation Guide for more information on how it generates a QuestionnaireResponse.

Step 4: DTR creates and updates the QuestionnaireResponse directly to the Data Source's FHIR Server and updates `Task.output` to reference the QuestionnaireResponse it created..

Step 5: When the QuestionnaireResponse is completed, the Provider "pushes" the QuestionnaireResponse directly to the Payer-defined endpoint using the $submit-attachments operation. See the Sending Attachments page for Implementation Guide for more information on this transaction.

Step 6: The Provider updates the Task to "completed" when complete - e.g., when the data has been submitted or the information gathered.

#### Using Da Vinci DTR to Complete the Questionnaire

The sequence diagram in Figure 18 below depicts the FHIR RESTful transactions and processes involved between the Payer, Provider, and DTR application application needed to request, fill, and return one or more questionnaires using using CDex Attachments. It references a "DTR Launch". If the DTR is a native EHR application, the launch is implementation specific. If DTR is a SMART on FHIR Application, the next (DTR SMART App Launch) section documents the launch sequence and parameters.

Figure 18

##### DTR SMART App Launch

The sequence diagram in Figure 19 below depicts the transactions between the DTR Client, FHIR Server, and DTR application needed to launch a DTR SMART App.

Preconditions and Assumptions:

- The DTR Client and FHIR Server are Provider (Data Source) roles.
- If the DTR is a native EHR application, the launch is implementation specific and this diagram does not apply.
- A User kicks off Smart Version 2.0.0 EHR launch flow.

Figure 19

Step 1 (Optional): The DTR App registers with DTR Client (may be out of band)

Step 2,3: If the `Task.code` is "attachment-request-questionnaire" (or "data-request-questionnaire" for the Task Based Approach), a User initiates Smart Version 2.0.0 EHR launch flow to launch DTR (for example, clicks a button to launch DTR) and DTR Client sends a launch request to the DTR App

Step 4: The DTR App retrieves the `.well-known/smart-configuration` from FHIR Server.

Step 5: The DTR App requests an authorization code with the following scopes:

- "launch"
- "launch/patient"
- "launch/task"
- "patient/*.rs"
- "patient/Task.u"
- "patient/QuestionnaireResponse.cu"

Step 6,7: Assuming the authorization is granted, The DTR app requests an access token

Step 8: The DTR App obtains an access token and the launch contexts in the "fhirContext" array, including a local reference to the Task in step 2.

Step 9: The DTR App uses the Task reference obtained in step 8 to fetch the Task, Questionnaire(s), and other resources it needs to fill out a QuestionnaireResponse(s). See the previous section (or this section on the Task Based Approach page) for more detailed transactions.

### Data Elements for Requesting Attachments

The Requesting Attachments Using Attachment Codes page documents the data elements needed to associate an attachment to a claim or prior authorization. However, there is no "Attachment Code" Data element when using Questionnaires to collect attachments-related data.

### Step-by-Step Solicited Attachment Transaction

In the following sections, A detailed look at an example Solicited attachment transaction illustrates how:

- The Payer uses a FHIR Questionnaire to communicate to the Provider what additional attachments-related data is needed.
- The Payer uses the CDex Task Attachment Request Profile to communicate to the Provider to complete the Questionnaire.
- The Provider launches DTR to fill out the FHIR Questionnaire using QuestionnaireResponse.
- The DTR completes the QuestionaireResponse and updates the Task.
- The Provider uses the $submit-attachment operation to communicate the completed QuestionnaireResponse to the Payer.

In this scenario, a Provider creates a prior authorization and sends it to the Payer. The Payer reviews the prior authorization and responds with a request to fill out a questionnaire for attachments-related data using the CDex Attachment Request Profile. After receiving the attachment request, the Provider launches DTR, which completes a QuestionnaireResponse. The Provider returns the QuestionnaireResponse using the `$submit-attachment` operation, posting it to the endpoint supplied in the request. The flow diagram in figure 20 below illustrates the scenario.

Figure 20: CDex Request Attachment for Prior-Auth Using Questionnaires

In addition to the information needed to submit and associate the attachments to the claim successfully, the Payer supplies the following details about what information is necessary to complete the adjudication of the claim:

- A link to the Questionnaire(s)
- Line numbers on the claim the requested attachment(s) are for
- The specific purpose of use (POU) for the request

The table below summarizes the mapping between the CDex Request Attachment Profile elements and the `$submit-attachment` parameters:

Data Element | CDex $submit-attachment Parameter | CDex Request Attachment Task Profile Element
--- | --- | ---
Tracking ID | TrackingId | Task.identifier
Administrative Reference Number | AdminRefNumber | Task.identifier
Use | AttachTo | Task.reasonCode
Payer ID | PayerId | Task.requester.identifier
Payer URL | (operation endpoint) | "PayerUrl" Task.input
Organization ID | OrganizationId | PractitionerRole.practitioner.identifier
Provider ID | ProviderId | PractitionerRole.organization.identifier
Line Item(s) | Attachment.LineItem | “AttachmentsNeeded” Task.input.extension
Attachment Code | Attachment.Code | “AttachmentsNeeded” Task.input
Member ID | MemberId | Patient.identifier
Questionnaire | - | “QuestionnairesContext” Task.input
QuestionnaireResponse | Attachment.Content | -

The data element mapping table is available as a CSV and Excel file.

#### Payer Requests Attachments for Prior Authorization

In the first FHIR transaction, the Payer POSTs the CDex Task Attachment Request Profile to the Provider endpoint.

    POST [base]/Task

Request Body

##### Task Resource

    0  {
    1    "resourceType" : "Task",

##### Verifying Patient Identity

The following data elements are used to verify the patient's identity. (This guide does not cover how the Provider system verifies the patient's identity.) They are communicated in a contained Patient resource using the CDex Patient Demographics Profile. The contained Patient is referenced in `Task.for.reference` using a fixed reference value of "#patient".

Data | HRex Patient Demographics Profile.
--- | ---
Member ID or Patient Account No.* | `Patient.identifier`
Patient Name | `Patient.name`
Patient DOB (optional) | `Patient.birthDate`

* Patient Account Number is a Provider assigned identifier

    2    "contained" : [{
    3      "resourceType" : "Patient",
    4      "id" : "patient",
    5      "identifier" : [{
    6        "use" : "usual",
    7        "type" : {
    8          "coding" : [{
    9            "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
    10            "code" : "MB",
    11            "display" : "Member Number"
    12          }],
    13          "text" : "Member Number"
    14        },
    15        "system" : "http://example.org/cdex/payer/member-ids",
    16        "value" : "Member123"
    17      },
    18      {
    19        "use" : "usual",
    20        "type" : {
    21          "coding" : [{
    22            "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",
    23            "code" : "pat",
    24            "display" : "Patient Account Number"
    25          }],
    26          "text" : "Patient Account Number"
    27        },
    28        "system" : "http://example.org/cdex/provider/patient-ids",
    29        "value" : "PA-123"
    30      }],
    31      "name" : [{
    32        "family" : "Shaw",
    33        "given" : ["Amy"]
    34      }],
    35      "birthDate" : "1987-02-20"
    36    },

##### Supplying the Provider ID(s)

The Payer communicates the provider ID as either a unique organization/location identifier (e.g., Type 2 NPI), unique provider identifier (e.g., Type 1 NPI), or both in a contained PractitionerRole resource using the CDex PractitionerRole Profile. This contained PractitionerRole is referenced in `Task.owner.reference` using a fixed reference value of "#practitionerrole".

    37    {
    38      "resourceType" : "PractitionerRole",
    39      "id" : "practitionerrole",
    40      "practitioner" : {
    41        "identifier" : {
    42          "system" : "http://hl7.org/fhir/sid/us-npi",
    43          "value" : "9941339100"
    44        }
    45      },
    46      "organization" : {
    47        "identifier" : {
    48          "system" : "http://hl7.org/fhir/sid/us-npi",
    49          "value" : "1234567893"
    50        }
    51      }

##### Supplying Identifiers for Associating the Attachments to a Claim or Prior Authorization

The mandatory `Task.identifier` tracking-id slice element, and, for prior authorization, the optional `Task.identifier` admin-ref-number slice element parameters represent payer tracking identifiers that tie the attachments back to the claim or prior authorization. The Provider will echo them back to the Payer when submitting the attachments.

    53    "identifier" : [{
    54      "type" : {
    55        "coding" : [{
    56          "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
    57          "code" : "tracking-id",
    58          "display" : "Tracking Id"
    59        }],
    60        "text" : "Re-Association Tracking Control Number"
    61      },
    62      "system" : "http://example.org/payer",
    63      "value" : "trackingid1012"
    64    },
    65    {
    66      "type" : {
    67        "coding" : [{
    68          "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
    69          "code" : "admin-ref-number",
    70          "display" : "Administrative Reference Number"
    71        }],
    72        "text" : "Administrative Reference Number"
    73      },
    74      "system" : "http://example.org/payer",
    75      "value" : "adminrefnumber4657"
    76    }],

##### Task status and intent Elements

These required Task infrastructure elements:

- `Task.status`
- `Task.intent`

convey the task status and the intent of the request. The `Task.status` value of "request" is typical when POSTing the Task-based attachment request. The status will change as the Task moves through the workflow based on the Task state machine. `Task.intent` is fixed to "order".

    77    "status" : "requested",
    78    "intent" : "order",

##### Task code Element

The `Task.code` communicates that the Payer is requesting attachments for a claim or prior authorization using a code or data request questionnaire. If the code is "attachment-request-code", the provider system returns attachment(s) identified by the attachment code(s) in the "code" input parameter. If the code is "attachment-request-questionnaire", as it is in this scenario, the provider system uses Documentation Templates and Rules (DTR) to complete the Questionnaire referenced in the "questionnaire" input parameter. The provider system uses the $submit-attachment operation to return the information to the endpoint provided in the `Task.input` "payer-url" parameter.

    79    "code" : {
    80      "coding" : [{
    81        "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    82        "code" : "attachment-request-questionnaire"
    83      }],
    84      "text" : "Attachment Request Questionnaire"
    85    },

##### Identifying the Payer, Provider, and Patient

The attachment request will be directed to the same Provider who submitted the claim or prior authorization. Business identifiers are used to identify the Patient, the Payer, and the Provider who submitted the claim, and these identifiers are echoed back to the Payer when submitting the attachments.

As discussed above, the patient ID is in the contained Patient resource, referenced by the `Task.for` element, and the provider ID is in the contained PractitionerRole resource, referenced by the `Task.owner` element. The provider ID can be a Practitioner identifier (i.e., a Type1 NPI), the Practitioner's Organization identifier (i.e., a Type2 NPI), or both.

(note the various Task dates in the request fragment below)

Actor | CDex Request Attachment Task Profile Element
--- | ---
payer ID | `Task.requester.identifier`
provider ID | (contained)PractitionerRole.practitioner. identifier or PractitionerRole.Organization.identifier
patient member ID or Patient Account No | (contained)Patient.identifier

    86    "for" : {
    87      "reference" : "#patient"
    88    },
    89    "authoredOn" : "2022-06-17T16:16:06Z",
    90    "lastModified" : "2022-06-17T16:16:06Z",
    91    "requester" : {
    92      "identifier" : {
    93        "system" : "http://example.org/cdex/payer/payer-ids",
    94        "value" : "Payer123"
    95      }
    96    },
    97    "owner" : {
    98      "reference" : "#practitionerrole"
    99    },

##### Claim Information

The Task communicates whether the attachments are for a claim or prior authorization, and the Payer identifies the claim or prior authorization with its business identifier.

Data | CDex Request Attachment Task Profile Element
--- | ---
Claim or Prior Authorization | `Task.reasonCode`
Claim or Prior Authorization ID | `Task.reasonReference.identifier`

    101      "coding" : [{
    102        "system" : "http://hl7.org/fhir/claim-use",
    103        "code" : "preauthorization",
    104        "display" : "Preauthorization"
    105      }],
    106      "text" : "preauthorization"
    107    },
    108    "reasonReference" : {
    109      "identifier" : {
    110        "system" : "http://example.org/cdex/payer/claim-ids",
    111        "value" : "Preauth123"
    112      }
    113    },
    114    "restriction" : {
    115      "period" : {
    116        "end" : "2022-06-21"

##### Attachment Due Date

The Payer communicates the due date for submitting the attachment in the `Task.restriction.period` element. Note that `Task.restriction.period.end` represents the time when the Provider should have submitted the attachments.

    114    "restriction" : {
    115      "period" : {
    116        "end" : "2022-06-21"
    117      }
    118    },

##### Using Questionnaire to Communicate What Attachments Data is Needed

In this scenario, the Payer supplies the URL of a questionnaire (FHIR Questionnaire) to communicate what attachments-related data is needed. They may also provide the line item numbers to match the attachment to a line item in the claim or prior authorization. This information is represented in the "questionnaire" `Task.input` element. The Provider launches the Documentation Templates and Rules (DTR) application to complete the Questionnaire. The code snippet below contains a URL to a Home Oxygen Therapy Questionnaire.

    119    "input" : [{
    120      "extension" : [{
    121        "url" : "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-paLineNumber",
    122        "valueInteger" : 1
    123      }],
    124      "type" : {
    125        "coding" : [{
    126          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    127          "code" : "questionnaire-context"
    128        }]
    129      },
    130      "valueCanonical" : "http://example.org/cdex-questionnaire-example1"
    131    },

##### Supplying the $submit-attachment Operation Endpoint

The Payer supplies the URL endpoint in the `Task.input` "payer-url" parameter. The Provider System uses this endpoint for the `$submit-attachment` operation to send the completed QuestionnaireResponse. Note that it is not necessarily a FHIR RESTful server endpoint.

    132    {
    133      "type" : {
    134        "coding" : [{
    135          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    136          "code" : "payer-url"
    137        }]
    138      },
    139      "valueUrl" : "http://example.org/cdex/payer/$submit-attachment"
    140    },
    141    {
    142      "type" : {

##### Purpose of Use for the Request

This optional `Task.input` element represents the request's purpose of use (POU). This example supports a request for prior authorization, "COVAUTH". When requesting attachments for a claim, it would be "CLMATTCH".

    141    {
    142      "type" : {
    143        "coding" : [{
    144          "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
    145          "code" : "purpose-of-use"
    146        }]
    147      },
    148      "valueCodeableConcept" : {
    149        "coding" : [{
    150          "system" : "http://terminology.hl7.org/CodeSystem/v3-ActReason",
    151          "code" : "COVAUTH",
    152          "display" : "coverage authorization"
    153        }]
    154      }
    155    }]
    156  }

#### Provider Launches DTR

The Payer used a Questionnaire to ask for specific attachments-related data. They indicated it with a `Task.code` "attachment-request-questionnaire" and supplied the URL of the questionnaire (FHIR Questionnaire) as an input parameter. Becasue these conditions are met, the Payer launches Da Vinci DTR, a SMART on FHIR App or native EHR application. If the Provider launches a DTR within an EHR native application, skip to the step DTR App Updates Task below. If the Provider Launches DTR as a SMART on FHIR Application, it follows the DTR SMART App Launch with the Task as the launch content. The next several steps describe the DTR SMART App functionality.

##### DTR SMART App Fetches Task

A reference to the Task is passed to the DTR App as part of the DTR launch. The DTR App fetches the Task and inspects it for the Questionnaire URL.

Request

    GET [base]/Task/cdex-task-example22

Response Body

    0  {
    1    "resourceType" : "Task",
    ...
    125        "coding" : [{
    126          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    127          "code" : "questionnaire-context"
    128        }]
    129      },
    130      "valueCanonical" : "http://example.org/cdex-questionnaire-example1"
    131    },
    132    {
    ....

##### DTR SMART App Fetches Questionnaire

Upon discovery of the Questionnaire URL, the DTR App fetches the Questionnaire.

Request

    GET http://example.org/FHIR/Questionnare/cdex-questionnaire-example1

Response Body

    0  {
    1    "resourceType" : "Questionnaire",
    2    "id" : "cdex-questionnaire-example1",
    3    "text" : {
    4      "status" : "extensions",
    5      "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: Questionnaire cdex-questionnaire-example1</b></p><a name=\"cdex-questionnaire-example1\"> </a><a name=\"hccdex-questionnaire-example1\"> </a><b>Structure</b><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;\"><tr style=\"border: 2px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top\"><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"The linkID for the item\">LinkID</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Text for the item\">Text</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Minimum and Maximum # of times the item can appear in the instance\">Cardinality</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"The type of the item\">Type</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Additional information about the item\">Description &amp; Constraints</a><span style=\"float: right\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Legend for this format\"><img src=\"data:image/png;base64, \" alt=\"doco\" style=\"background-color: inherit\"/></a></span></th></tr><tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_q_root.gif\" alt=\".\" style=\"background-color: white; background-color: inherit\" title=\"QuestionnaireRoot\" class=\"hierarchy\"/> HomeOxygenTherapyQuestionnaire</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Questionnaire</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">http://example.org/cdex-questionnaire-example1#2.1.0</td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)\" id=\"item.1\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon-q-text.png\" alt=\".\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"text\" class=\"hierarchy\"/> 1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">1..1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/codesystem-item-type.html#item-type-text\">text</a></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck00.png)\" id=\"item.2\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin_end.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon-q-coding.png\" alt=\".\" style=\"background-color: white; background-color: inherit\" title=\"coding\" class=\"hierarchy\"/> 2</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Order Reason</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">1..1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/codesystem-item-type.html#item-type-choice\">choice</a></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Options: <a href=\"#opt-item.2\">4 options</a></td></tr>\r\n<tr><td colspan=\"5\" class=\"hierarchy\"><br/><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Legend for this format\"><img src=\"data:image/png;base64, \" alt=\"doco\" style=\"background-color: inherit\"/> Documentation for this format</a></td></tr></table><hr/><p><b>Options Sets</b></p><a name=\"opt-item.2\"> </a><p><b>Answer options for 2 </b></p><ul><li style=\"font-size: 11px\">http://example.org#1 (&quot;Initial or original order for certification&quot;)</li><li style=\"font-size: 11px\">http://example.org#2 (&quot;Change in status&quot;)</li><li style=\"font-size: 11px\">http://example.org#3 (&quot;Revision or change in equipment&quot;)</li><li style=\"font-size: 11px\">http://example.org#4 (&quot;Replacement&quot;)</li></ul></div>"
    6    },
    7    "url" : "http://example.org/cdex-questionnaire-example1",
    8    "identifier" : [{
    9      "system" : "urn:ietf:rfc:3986",
    10      "value" : "urn:oid:2.16.840.1.113883.4.642.40.21.35.1"
    11    }],
    12    "version" : "2.1.0",
    13    "name" : "HomeOxygenTherapyQuestionnaire",
    14    "title" : "Home Oxygen Therapy Questionnaire",
    15    "status" : "active",
    16    "subjectType" : ["Patient"],
    17    "date" : "2022-01-17",
    18    "publisher" : "HL7 International / Payer/Provider Information Exchange Work Group",
    19    "contact" : [{
    20      "name" : "HL7 International / Payer/Provider Information Exchange Work Group",
    21      "telecom" : [{
    22        "system" : "url",
    23        "value" : "http://www.hl7.org/Special/committees/claims"
    24      },
    25      {
    26        "system" : "email",
    27        "value" : "pie@lists.hl7.org"
    28      }]
    29    }],
    30    "jurisdiction" : [{
    31      "coding" : [{
    32        "system" : "urn:iso:std:iso:3166",
    33        "code" : "US"
    34      }]
    35    }],
    36    "copyright" : "Used by permission of HL7 International all rights reserved Creative Commons License",
    37    "item" : [{
    38      "linkId" : "1",
    39      "text" : "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)",
    40      "type" : "text",
    41      "required" : true
    42    },
    43    {
    44      "linkId" : "2",
    45      "text" : "Order Reason",
    46      "type" : "choice",
    47      "required" : true,
    48      "answerOption" : [{
    49        "valueCoding" : {
    50          "system" : "http://example.org",
    51          "code" : "1",
    52          "display" : "Initial or original order for certification"
    53        }
    54      },
    55      {
    56        "valueCoding" : {
    57          "system" : "http://example.org",
    58          "code" : "2",
    59          "display" : "Change in status"
    60        }
    61      },
    62      {
    63        "valueCoding" : {
    64          "system" : "http://example.org",
    65          "code" : "3",
    66          "display" : "Revision or change in equipment"
    67        }
    68      },
    69      {
    70        "valueCoding" : {
    71          "system" : "http://example.org",
    72          "code" : "4",
    73          "display" : "Replacement"
    74        }
    75      }]
    76    }]
    77  }

##### DTR App Fills QuestionnaireResponse

To complete the Questionnaire, the DTR App retrieves FHIR resources from EHRs, runs rules (such as CQL) for form population, and completes a QuestionnaireResponse. See the Da Vinci DTR Implementation Guide for more information.

##### DTR App POSTs QuestionnaireResponse to Provider FHIR Server

The completed QuestionnaireResponse is saved in the Provider's FHIR Server.

Request

    POST [base]/$QuestionnaireResponse

Request Body

    0  {
    1    "resourceType" : "QuestionnaireResponse",
    2    "questionnaire" : "http://example.org/cdex-questionnaire-example1",
    3    "status" : "completed",
    4    "subject" : {
    5      "identifier" : {
    6        "use" : "usual",
    7        "type" : {
    8          "coding" : [{
    9            "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
    10            "code" : "MB",
    11            "display" : "Member Number"
    12          }],
    13          "text" : "Member Number"
    14        },
    15        "system" : "http://example.org/cdex/payer/member-ids",
    16        "value" : "Member123"
    17      },
    18      "display" : "Amy Shaw"
    19    },
    20    "authored" : "2022-06-17",
    21    "author" : {
    22      "identifier" : {
    23        "system" : "http://hl7.org/fhir/sid/us-npi",
    24        "value" : "9941339100"
    25      }
    26    },
    27    "item" : [{
    28      "linkId" : "1",
    29      "text" : "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)",
    30      "answer" : [{
    31        "valueString" : "Examplitis"
    32      }]
    33    },
    34    {
    35      "linkId" : "2",
    36      "text" : "Order Reason",
    37      "answer" : [{
    38        "valueCoding" : {
    39          "system" : "http://example.org",
    40          "code" : "4",
    41          "display" : "Replacement"
    42        }
    43      }]
    44    }]
    45  }

##### DTR App Updates Task

The DTR SMART App or EHR native application Updates `Task.output` to Reference the completed QuestionnaireResponse.

    PUT [base]/Task/cdex-task-example-22

Request Body

    0  {
    1    "resourceType": "Task",
    2    "id": "cdex-task-example22",
    ...
    217      {
    218        "type": {
    219          "coding": [
    220            {
    221              "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/temp",
    222              "code": "questionnaire-response"
    223            }
    224          ]
    225        },
    226        "valueReference": {
    227          "reference": "QuestionnaireResponse/cdex-questionnaireresponse-example1"
    228        }
    229      }
    230    ]
    231  }

#### Provider Submits Solicited Attachments

When the Task is completed, the Provider POSTs the `$submit-attachment` operation and its payload to the Payer's endpoint communicated in the `Task.input` "payer-url" parameter. The operation payload contains the completed QuestionnaireResponse(s) and echoes many data elements sent in the request. The table in the introduction to this section summarizes the mapping between the CDex Request Attachment Profile elements and the `$submit-attachment` parameters. The documentation below describes and demonstrates the `$submit-attachment` parameters.

Data Element | CDex Request Attachment Task Profile Element | CDex #submit-attachment Parameter
--- | --- | ---
Payer URL | "payer-url"Task.input | (operation endpoint)

Request

    POST [base]/$submit-attachment

Request Body

##### The Submit Attachment Operation Payload

The attachments and metadata needed to associate the attachment to the claim or prior authorization are in the `$submit-attachment` payload, a Parameters resource.

    0  {
    1    "resourceType" : "Parameters",
    2    "parameter" : [{

##### Identifiers for Associating the Attachments to a Claim or Prior Authorization

The "TrackingId" and, for prior authorization, "AdminRefNumber" parameters represent Payer-assigned business identifiers that tie the requested attachments to the claim or prior authorization. The operation must also indicate whether the attachments are for claim or prior authorization. These data elements are taken from the CDex request as follows:

Data Element | CDex Request Attachment Task Profile Element | CDex #submit-attachment Parameter
--- | --- | ---
TrackingID | Task.identifier | TrackingId
AdminRefNumber (prior authorizations only) | Task.identifier | AdminRefNumber
Use | Task.reasonCode | AttachTo

    3      "name" : "TrackingId",
    4      "valueIdentifier" : {
    5        "system" : "http://example.org/payer-acns",
    6        "value" : "trackingid1012"
    7      }
    8    },
    9    {
    10      "name" : "AdminRefNumber",
    11      "valueIdentifier" : {
    12        "system" : "http://example.org/payer-refnos",
    13        "value" : "adminrefnumber4657"
    14      }
    15    },
    16    {
    17      "name" : "AttachTo",
    18      "valueCode" : "preauthorization"
    19    },

##### Identifying the Payer, Provider, Organization, and Patient

As documented above, The Payer uses business identifiers to identify itself, the Patient, the Provider (i.e., the practitioner), and the Organization (i.e., the provider organization) who submitted the claim or prior authorization. The Provider uses these same identifiers when submitting the attachments.

Data Element | CDex Request Attachment Task Profile Element | CDex #submit-attachment Parameter
--- | --- | ---
Payer ID | Task.requester.identifier | PayerId
Organization ID | PractitionerRole.organization.identifier | OrganizationId
Provider ID | PractitionerRole.practitioner.identifier | ProviderId
Member ID | Patient.identifier | MemberId

    20    {
    21      "name" : "PayerId",
    22      "valueIdentifier" : {
    23        "system" : "http://example.org/cdex/payer/payer-ids",
    24        "value" : "payer123"
    25      }
    26    },
    27    {
    28      "name" : "OrganizationId",
    29      "valueIdentifier" : {
    30        "system" : "http://hl7.org/fhir/sid/us-npi",
    31        "value" : "1234567893"
    32      }
    33    },
    34    {
    35      "name" : "ProviderId",
    36      "valueIdentifier" : {
    37        "system" : "http://hl7.org/fhir/sid/us-npi",
    38        "value" : "9941339100"
    39      }
    40    },
    41    {
    42      "name" : "MemberId",
    43      "valueIdentifier" : {
    44        "system" : "http://example.org/cdex/payer/member-ids",
    45        "value" : "Member123"
    46      }
    47    },

##### Supply the QuestionnaireResponse

The completed QuestionnaireResponse and line item numbers are communicated as "Attachment" parameter parts. The QuestionnaireResponse is in the `Attachment.Content` parameter part as an inline FHIR resource, and the line item numbers associated with it are sent in the `Attachment.LineItem` parameter part.

Data Element | CDex Request Attachment Task Profile Element | CDex #submit-attachment Parameter
--- | --- | ---
line item(s) | “code”Task.input.extension | Attachment.LineItem
QuestionnaireResponse | - | Attachment.content

    48    {
    49      "name" : "Attachment",
    50      "part" : [{
    51        "name" : "LineItem",
    52        "valueString" : "1"
    53      },
    54      {
    55        "name" : "Content",
    56        "resource" : {
    57          "resourceType" : "QuestionnaireResponse",
    58          "id" : "cdex-questionnaireresponse-example1",
    59          "questionnaire" : "http://example.org/cdex-questionnaire-example1",
    60          "status" : "completed",
    61          "subject" : {
    62            "identifier" : {
    63              "use" : "usual",
    64              "type" : {
    65                "coding" : [{
    66                  "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
    67                  "code" : "MB",
    68                  "display" : "Member Number"
    69                }],
    70                "text" : "Member Number"
    71              },
    72              "system" : "http://example.org/cdex/payer/member-ids",
    73              "value" : "Member123"
    74            },
    75            "display" : "Amy Shaw"
    76          },
    77          "authored" : "2022-06-17",
    78          "author" : {
    79            "identifier" : {
    80              "system" : "http://hl7.org/fhir/sid/us-npi",
    81              "value" : "9941339100"
    82            }
    83          },
    84          "item" : [{
    85            "linkId" : "1",
    86            "text" : "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)",
    87            "answer" : [{
    88              "valueString" : "Examplitis"
    89            }]
    90          },
    91          {
    92            "linkId" : "2",
    93            "text" : "Order Reason",
    94            "answer" : [{
    95              "valueCoding" : {
    96                "system" : "http://example.org",
    97                "code" : "4",
    98                "display" : "Replacement"
    99              }
    100            }]
    101          }]
    102        }
    103      }]
    104    }]
    105  }

### Complete Solicited Attachment Transaction

The example below shows the complete solicited attachment transaction. A Payer uses the CDex Task Attachment Request Profile to request the attachment using an attachment code, and the Provider uses the `$submit-attachment` operation to submit the attachments to the Payer:

#### Step 1 - POST Task to Provider endpoint

Request

    POST [base]/Task

Request Headers

    Accept: application/fhir+json
    Content-Type: application/fhir+json
    ...(other headers)

Request Body

    {
      "resourceType" : "Task",
      "contained" : [{
        "resourceType" : "Patient",
        "id" : "patient",
        "identifier" : [{
          "use" : "usual",
          "type" : {
            "coding" : [{
              "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
              "code" : "MB",
              "display" : "Member Number"
            }],
            "text" : "Member Number"
          },
          "system" : "http://example.org/cdex/payer/member-ids",
          "value" : "Member123"
        },
        {
          "use" : "usual",
          "type" : {
            "coding" : [{
              "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",
              "code" : "pat",
              "display" : "Patient Account Number"
            }],
            "text" : "Patient Account Number"
          },
          "system" : "http://example.org/cdex/provider/patient-ids",
          "value" : "PA-123"
        }],
        "name" : [{
          "family" : "Shaw",
          "given" : ["Amy"]
        }],
        "birthDate" : "1987-02-20"
      },
      {
        "resourceType" : "PractitionerRole",
        "id" : "practitionerrole",
        "practitioner" : {
          "identifier" : {
            "system" : "http://hl7.org/fhir/sid/us-npi",
            "value" : "9941339100"
          }
        },
        "organization" : {
          "identifier" : {
            "system" : "http://hl7.org/fhir/sid/us-npi",
            "value" : "1234567893"
          }
        }
      }],
      "identifier" : [{
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code" : "tracking-id",
            "display" : "Tracking Id"
          }],
          "text" : "Re-Association Tracking Control Number"
        },
        "system" : "http://example.org/payer",
        "value" : "trackingid1012"
      },
      {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code" : "admin-ref-number",
            "display" : "Administrative Reference Number"
          }],
          "text" : "Administrative Reference Number"
        },
        "system" : "http://example.org/payer",
        "value" : "adminrefnumber4657"
      }],
      "status" : "requested",
      "intent" : "order",
      "code" : {
        "coding" : [{
          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
          "code" : "attachment-request-questionnaire"
        }],
        "text" : "Attachment Request Questionnaire"
      },
      "for" : {
        "reference" : "#patient"
      },
      "authoredOn" : "2022-06-17T16:16:06Z",
      "lastModified" : "2022-06-17T16:16:06Z",
      "requester" : {
        "identifier" : {
          "system" : "http://example.org/cdex/payer/payer-ids",
          "value" : "Payer123"
        }
      },
      "owner" : {
        "reference" : "#practitionerrole"
      },
      "reasonCode" : {
        "coding" : [{
          "system" : "http://hl7.org/fhir/claim-use",
          "code" : "preauthorization",
          "display" : "Preauthorization"
        }],
        "text" : "preauthorization"
      },
      "reasonReference" : {
        "identifier" : {
          "system" : "http://example.org/cdex/payer/claim-ids",
          "value" : "Preauth123"
        }
      },
      "restriction" : {
        "period" : {
          "end" : "2022-06-21"
        }
      },
      "input" : [{
        "extension" : [{
          "url" : "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-paLineNumber",
          "valueInteger" : 1
        }],
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
            "code" : "questionnaire-context"
          }]
        },
        "valueCanonical" : "http://example.org/cdex-questionnaire-example1"
      },
      {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
            "code" : "payer-url"
          }]
        },
        "valueUrl" : "http://example.org/cdex/payer/$submit-attachment"
      },
      {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code" : "purpose-of-use"
          }]
        },
        "valueCodeableConcept" : {
          "coding" : [{
            "system" : "http://terminology.hl7.org/CodeSystem/v3-ActReason",
            "code" : "COVAUTH",
            "display" : "coverage authorization"
          }]
        }
      }]
    }

Response Headers

    HTTP/1.1 200 OK

    Server: CDEX Example Provider Server

    Location: http://example.org/FHIR/Task/cdex-task-example22/_history/1

    ...(other headers)

#### Step 2 - Provider Invokes DTR To Complete Questionnaire

If the Provider Launches DTR as a SMART on FHIR Application in SMART’s EHR launch flow, proceed to step 3 If the Provider launches a DTR within an EHR native application, skip to step 7

#### Step 3 - DTR App Fetches Task

Request

    GET [base]/Task/cdex-task-example22

Response Headers

    HTTP/1.1 200 OK

    Server: CDEX Example Provider Server

    Location: http://example.org/FHIR/Task/cdex-task-example22/_history/1

    ...(other headers)

Response Body

    {
      "resourceType" : "Task",
      "id" : "cdex-task-example22",
      "text" : {
        "status" : "extensions",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: Task cdex-task-example22</b></p><a name=\"cdex-task-example22\"> </a><a name=\"hccdex-task-example22\"> </a><p><b>identifier</b>: Re-Association Tracking Control Number/trackingid1012, Administrative Reference Number/adminrefnumber4657</p><p><b>status</b>: In Progress</p><p><b>intent</b>: order</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes attachment-request-questionnaire}\">Attachment Request Questionnaire</span></p><p><b>for</b>: <a href=\"#hccdex-task-example22/patient\">Amy Shaw  (no stated gender), DoB: 1987-02-20 ( Patient Account Number:\u00a0PA-123\u00a0(use:\u00a0usual,\u00a0))</a></p><p><b>authoredOn</b>: 2022-06-17 16:16:06+0000</p><p><b>lastModified</b>: 2022-06-17 16:16:06+0000</p><p><b>requester</b>: Identifier: <code>http://example.org/cdex/payer/payer-ids</code>/Payer123</p><p><b>owner</b>: <a href=\"#hccdex-task-example22/practitionerrole\">PractitionerRole</a></p><p><b>reasonCode</b>: <span title=\"Codes:{http://hl7.org/fhir/claim-use preauthorization}\">preauthorization</span></p><p><b>reasonReference</b>: Identifier: <code>http://example.org/cdex/payer/claim-ids</code>/Preauth123</p><h3>Restrictions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Period</b></td></tr><tr><td style=\"display: none\">*</td><td>?? --&gt; 2022-06-21</td></tr></table><blockquote><p><b>input</b></p><p><b>PALineNumber</b>: 1</p><p><b>type</b>: <span title=\"Codes:{http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes questionnaire-context}\">Questionnaire Context</span></p><p><b>value</b>: <a href=\"Questionnaire-cdex-questionnaire-example1.html\">Home Oxygen Therapy Questionnaire</a></p></blockquote><blockquote><p><b>input</b></p><p><b>type</b>: <span title=\"Codes:{http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes payer-url}\">Payer URL</span></p><p><b>value</b>: <a href=\"http://example.org/cdex/payer/$submit-attachment\">http://example.org/cdex/payer/$submit-attachment</a></p></blockquote><blockquote><p><b>input</b></p><p><b>type</b>: <span title=\"Codes:{http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp purpose-of-use}\">Purpose Of Use</span></p><p><b>value</b>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/v3-ActReason COVAUTH}\">coverage authorization</span></p></blockquote><hr/><blockquote><p class=\"res-header-id\"><b>Generated Narrative: Patient #patient</b></p><a name=\"cdex-task-example22/patient\"> </a><a name=\"hccdex-task-example22/patient\"> </a><p style=\"border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;\">Amy Shaw  (no stated gender), DoB: 1987-02-20 ( Patient Account Number:\u00a0PA-123\u00a0(use:\u00a0usual,\u00a0))</p><hr/><table class=\"grid\"><tr><td style=\"background-color: #f3f5da\" title=\"Other Id (see the one above)\">Other Id:</td><td colspan=\"3\">Member Number/Member123\u00a0(use:\u00a0usual,\u00a0)</td></tr></table></blockquote><hr/><blockquote><p class=\"res-header-id\"><b>Generated Narrative: PractitionerRole #practitionerrole</b></p><a name=\"cdex-task-example22/practitionerrole\"> </a><a name=\"hccdex-task-example22/practitionerrole\"> </a><p><b>practitioner</b>: Identifier: <a href=\"http://terminology.hl7.org/5.3.0/NamingSystem-npi.html\" title=\"National Provider Identifier\">United States National Provider Identifier</a>/9941339100</p><p><b>organization</b>: Identifier: <a href=\"http://terminology.hl7.org/5.3.0/NamingSystem-npi.html\" title=\"National Provider Identifier\">United States National Provider Identifier</a>/1234567893</p></blockquote></div>"
      },
      "contained" : [{
        "resourceType" : "Patient",
        "id" : "patient",
        "identifier" : [{
          "use" : "usual",
          "type" : {
            "coding" : [{
              "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
              "code" : "MB",
              "display" : "Member Number"
            }],
            "text" : "Member Number"
          },
          "system" : "http://example.org/cdex/payer/member-ids",
          "value" : "Member123"
        },
        {
          "use" : "usual",
          "type" : {
            "coding" : [{
              "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",
              "code" : "pat",
              "display" : "Patient Account Number"
            }],
            "text" : "Patient Account Number"
          },
          "system" : "http://example.org/cdex/provider/patient-ids",
          "value" : "PA-123"
        }],
        "name" : [{
          "family" : "Shaw",
          "given" : ["Amy"]
        }],
        "birthDate" : "1987-02-20"
      },
      {
        "resourceType" : "PractitionerRole",
        "id" : "practitionerrole",
        "practitioner" : {
          "identifier" : {
            "system" : "http://hl7.org/fhir/sid/us-npi",
            "value" : "9941339100"
          }
        },
        "organization" : {
          "identifier" : {
            "system" : "http://hl7.org/fhir/sid/us-npi",
            "value" : "1234567893"
          }
        }
      }],
      "identifier" : [{
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code" : "tracking-id",
            "display" : "Tracking Id"
          }],
          "text" : "Re-Association Tracking Control Number"
        },
        "system" : "http://example.org/payer",
        "value" : "trackingid1012"
      },
      {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code" : "admin-ref-number",
            "display" : "Administrative Reference Number"
          }],
          "text" : "Administrative Reference Number"
        },
        "system" : "http://example.org/payer",
        "value" : "adminrefnumber4657"
      }],
      "status" : "in-progress",
      "intent" : "order",
      "code" : {
        "coding" : [{
          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
          "code" : "attachment-request-questionnaire"
        }],
        "text" : "Attachment Request Questionnaire"
      },
      "for" : {
        "reference" : "#patient"
      },
      "authoredOn" : "2022-06-17T16:16:06Z",
      "lastModified" : "2022-06-17T16:16:06Z",
      "requester" : {
        "identifier" : {
          "system" : "http://example.org/cdex/payer/payer-ids",
          "value" : "Payer123"
        }
      },
      "owner" : {
        "reference" : "#practitionerrole"
      },
      "reasonCode" : {
        "coding" : [{
          "system" : "http://hl7.org/fhir/claim-use",
          "code" : "preauthorization",
          "display" : "Preauthorization"
        }],
        "text" : "preauthorization"
      },
      "reasonReference" : {
        "identifier" : {
          "system" : "http://example.org/cdex/payer/claim-ids",
          "value" : "Preauth123"
        }
      },
      "restriction" : {
        "period" : {
          "end" : "2022-06-21"
        }
      },
      "input" : [{
        "extension" : [{
          "url" : "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-paLineNumber",
          "valueInteger" : 1
        }],
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
            "code" : "questionnaire-context"
          }]
        },
        "valueCanonical" : "http://example.org/cdex-questionnaire-example1",
        "_valueCanonical" : {
          "extension" : [{
            "url" : "http://hl7.org/fhir/StructureDefinition/display",
            "valueString" : "Home Oxygen Therapy Questionnaire"
          }]
        }
      },
      {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
            "code" : "payer-url"
          }]
        },
        "valueUrl" : "http://example.org/cdex/payer/$submit-attachment"
      },
      {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code" : "purpose-of-use"
          }]
        },
        "valueCodeableConcept" : {
          "coding" : [{
            "system" : "http://terminology.hl7.org/CodeSystem/v3-ActReason",
            "code" : "COVAUTH",
            "display" : "coverage authorization"
          }]
        }
      }]
    }

#### Step 4 - DTR App Inspects Task for Questionnaire Canonical URL and fetches the "Questionnaire"

Request

    GET http://example.org/FHIR/Questionnare/cdex-questionnaire-example1

Response Headers

    HTTP/1.1 200 OK

    Server: CDEX Example Provider Server

    Location: http://example.org/FHIR/Questionnare/cdex-questionnaire-example1

    ...(other headers)

Response Body

    {
      "resourceType" : "Questionnaire",
      "id" : "cdex-questionnaire-example1",
      "text" : {
        "status" : "extensions",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: Questionnaire cdex-questionnaire-example1</b></p><a name=\"cdex-questionnaire-example1\"> </a><a name=\"hccdex-questionnaire-example1\"> </a><b>Structure</b><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;\"><tr style=\"border: 2px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top\"><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"The linkID for the item\">LinkID</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Text for the item\">Text</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Minimum and Maximum # of times the item can appear in the instance\">Cardinality</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"The type of the item\">Type</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Additional information about the item\">Description &amp; Constraints</a><span style=\"float: right\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Legend for this format\"><img src=\"data:image/png;base64, \" alt=\"doco\" style=\"background-color: inherit\"/></a></span></th></tr><tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_q_root.gif\" alt=\".\" style=\"background-color: white; background-color: inherit\" title=\"QuestionnaireRoot\" class=\"hierarchy\"/> HomeOxygenTherapyQuestionnaire</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Questionnaire</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">http://example.org/cdex-questionnaire-example1#2.1.0</td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)\" id=\"item.1\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon-q-text.png\" alt=\".\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"text\" class=\"hierarchy\"/> 1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">1..1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/codesystem-item-type.html#item-type-text\">text</a></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck00.png)\" id=\"item.2\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin_end.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon-q-coding.png\" alt=\".\" style=\"background-color: white; background-color: inherit\" title=\"coding\" class=\"hierarchy\"/> 2</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Order Reason</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">1..1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/codesystem-item-type.html#item-type-choice\">choice</a></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Options: <a href=\"#opt-item.2\">4 options</a></td></tr>\r\n<tr><td colspan=\"5\" class=\"hierarchy\"><br/><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Legend for this format\"><img src=\"data:image/png;base64, \" alt=\"doco\" style=\"background-color: inherit\"/> Documentation for this format</a></td></tr></table><hr/><p><b>Options Sets</b></p><a name=\"opt-item.2\"> </a><p><b>Answer options for 2 </b></p><ul><li style=\"font-size: 11px\">http://example.org#1 (&quot;Initial or original order for certification&quot;)</li><li style=\"font-size: 11px\">http://example.org#2 (&quot;Change in status&quot;)</li><li style=\"font-size: 11px\">http://example.org#3 (&quot;Revision or change in equipment&quot;)</li><li style=\"font-size: 11px\">http://example.org#4 (&quot;Replacement&quot;)</li></ul></div>"
      },
      "url" : "http://example.org/cdex-questionnaire-example1",
      "identifier" : [{
        "system" : "urn:ietf:rfc:3986",
        "value" : "urn:oid:2.16.840.1.113883.4.642.40.21.35.1"
      }],
      "version" : "2.1.0",
      "name" : "HomeOxygenTherapyQuestionnaire",
      "title" : "Home Oxygen Therapy Questionnaire",
      "status" : "active",
      "subjectType" : ["Patient"],
      "date" : "2022-01-17",
      "publisher" : "HL7 International / Payer/Provider Information Exchange Work Group",
      "contact" : [{
        "name" : "HL7 International / Payer/Provider Information Exchange Work Group",
        "telecom" : [{
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/claims"
        },
        {
          "system" : "email",
          "value" : "pie@lists.hl7.org"
        }]
      }],
      "jurisdiction" : [{
        "coding" : [{
          "system" : "urn:iso:std:iso:3166",
          "code" : "US"
        }]
      }],
      "copyright" : "Used by permission of HL7 International all rights reserved Creative Commons License",
      "item" : [{
        "linkId" : "1",
        "text" : "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)",
        "type" : "text",
        "required" : true
      },
      {
        "linkId" : "2",
        "text" : "Order Reason",
        "type" : "choice",
        "required" : true,
        "answerOption" : [{
          "valueCoding" : {
            "system" : "http://example.org",
            "code" : "1",
            "display" : "Initial or original order for certification"
          }
        },
        {
          "valueCoding" : {
            "system" : "http://example.org",
            "code" : "2",
            "display" : "Change in status"
          }
        },
        {
          "valueCoding" : {
            "system" : "http://example.org",
            "code" : "3",
            "display" : "Revision or change in equipment"
          }
        },
        {
          "valueCoding" : {
            "system" : "http://example.org",
            "code" : "4",
            "display" : "Replacement"
          }
        }]
      }]
    }

#### Step 5 - DTR App Fills QuestionnaireResponse

#### Step 6 - DTR App POSTs QuestionnaireResponse to Provider FHIR Server

Request

    POST [base]/QuestionnaireResponse

Request Headers

    Accept: application/fhir+json
    Content-Type: application/fhir+json
    ...(other headers)

Request Body

    {
      "resourceType" : "QuestionnaireResponse",
      "id" : "cdex-questionnaireresponse-example1",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: QuestionnaireResponse cdex-questionnaireresponse-example1</b></p><a name=\"cdex-questionnaireresponse-example1\"> </a><a name=\"hccdex-questionnaireresponse-example1\"> </a><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;\"><tr style=\"border: 2px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top\"><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"The linkID for the item\">LinkID</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Text for the item\">Text</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Minimum and Maximum # of times the item can appear in the instance\">Definition</a></th><th style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"The type of the item\">Answer</a><span style=\"float: right\"><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Legend for this format\"><img src=\"data:image/png;base64, \" alt=\"doco\" style=\"background-color: inherit\"/></a></span></th></tr><tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_q_root.gif\" alt=\".\" style=\"background-color: white; background-color: inherit\" title=\"QuestionnaireResponseRoot\" class=\"hierarchy\"/> cdex-questionnaireresponse-example1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Questionnaire:<a href=\"Questionnaire-cdex-questionnaire-example1.html\">Home Oxygen Therapy Questionnaire</a></td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon-q-string.png\" alt=\".\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"Item\" class=\"hierarchy\"/> 1</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Examplitis</td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck00.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin_end.png\" alt=\".\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon-q-string.png\" alt=\".\" style=\"background-color: white; background-color: inherit\" title=\"Item\" class=\"hierarchy\"/> 2</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Order Reason</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span><span>example.org 4: Replacement</span></span></td></tr>\r\n<tr><td colspan=\"4\" class=\"hierarchy\"><br/><a href=\"https://hl7.org/fhir/R4/formats.html#table\" title=\"Legend for this format\"><img src=\"data:image/png;base64, \" alt=\"doco\" style=\"background-color: inherit\"/> Documentation for this format</a></td></tr></table></div>"
      },
      "questionnaire" : "http://example.org/cdex-questionnaire-example1",
      "status" : "completed",
      "subject" : {
        "identifier" : {
          "use" : "usual",
          "type" : {
            "coding" : [{
              "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
              "code" : "MB",
              "display" : "Member Number"
            }],
            "text" : "Member Number"
          },
          "system" : "http://example.org/cdex/payer/member-ids",
          "value" : "Member123"
        },
        "display" : "Amy Shaw"
      },
      "authored" : "2022-06-17",
      "author" : {
        "identifier" : {
          "system" : "http://hl7.org/fhir/sid/us-npi",
          "value" : "9941339100"
        }
      },
      "item" : [{
        "linkId" : "1",
        "text" : "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)",
        "answer" : [{
          "valueString" : "Examplitis"
        }]
      },
      {
        "linkId" : "2",
        "text" : "Order Reason",
        "answer" : [{
          "valueCoding" : {
            "system" : "http://example.org",
            "code" : "4",
            "display" : "Replacement"
          }
        }]
      }]
    }

Response Headers

    HTTP/1.1 200 OK

    Server: CDEX Example Provider Server

    Location: http://example.org/FHIR/QuestionnaireResponse/cdex-questionnaireresponse-inline-example1/_history/1

    ...(other headers)

#### Step 7 - The DTR SMART App or EHR native application Updates Task.output to Reference QuestionnaireResponse

Request

    PUT [base]/Task/cdex-task-example-22

Request Headers

    Accept: application/fhir+json
    Content-Type: application/fhir+json
    ...(other headers)

Request Body

    {
      "resourceType": "Task",
      "id": "cdex-task-example22",
      "meta": {
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/instance-name",
            "valueString": "Inline Task Example22 Updateid"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/instance-description",
            "valueMarkdown": "Task example used to create inline scenarios for this guide"
          }
        ],
        "profile": [
          "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-task-attachment-request"
        ]
      },
      "contained": [
        {
          "resourceType": "Patient",
          "id": "patient",
          "meta": {
            "profile": [
              "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-patient-demographics"
            ]
          },
          "identifier": [
            {
              "use": "usual",
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                    "code": "MB",
                    "display": "Member Number"
                  }
                ],
                "text": "Member Number"
              },
              "system": "http://example.org/cdex/payer/member-ids",
              "value": "Member123"
            },
            {
              "use": "usual",
              "type": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",
                    "code": "pat",
                    "display": "Patient Account Number"
                  }
                ],
                "text": "Patient Account Number"
              },
              "system": "http://example.org/cdex/provider/patient-ids",
              "value": "PA-123"
            }
          ],
          "name": [
            {
              "family": "Shaw",
              "given": [
                "Amy"
              ]
            }
          ],
          "birthDate": "1987-02-20"
        },
        {
          "resourceType": "PractitionerRole",
          "id": "practitionerrole",
          "meta": {
            "profile": [
              "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-practitionerrole"
            ]
          },
          "practitioner": {
            "identifier": {
              "system": "http://hl7.org/fhir/sid/us-npi",
              "value": "9941339100"
            }
          },
          "organization": {
            "identifier": {
              "system": "http://hl7.org/fhir/sid/us-npi",
              "value": "1234567893"
            }
          }
        }
      ],
      "identifier": [
        {
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
                "code": "tracking-id",
                "display": "Tracking Id"
              }
            ],
            "text": "Re-Association Tracking Control Number"
          },
          "system": "http://example.org/payer",
          "value": "trackingid1012"
        },
        {
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
                "code": "admin-ref-number",
                "display": "Administrative Reference Number"
              }
            ],
            "text": "Administrative Reference Number"
          },
          "system": "http://example.org/payer",
          "value": "adminrefnumber4657"
        }
      ],
      "status": "in-progress",
      "intent": "order",
      "code": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
            "code": "attachment-request-questionnaire"
          }
        ],
        "text": "Attachment Request Questionnaire"
      },
      "for": {
        "reference": "#patient"
      },
      "authoredOn": "2022-06-17T16:16:06+00:00",
      "lastModified": "2022-06-17T16:17:06+00:00",
      "requester": {
        "identifier": {
          "system": "http://example.org/cdex/payer/payer-ids",
          "value": "Payer123"
        }
      },
      "owner": {
        "reference": "#practitionerrole"
      },
      "reasonCode": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/claim-use",
            "code": "preauthorization",
            "display": "Preauthorization"
          }
        ],
        "text": "preauthorization"
      },
      "reasonReference": {
        "identifier": {
          "system": "http://example.org/cdex/payer/claim-ids",
          "value": "Preauth123"
        }
      },
      "restriction": {
        "period": {
          "end": "2022-06-21"
        }
      },
      "input": [
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-paLineNumber",
              "valueInteger": 1
            }
          ],
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/temp",
                "code": "questionnaire"
              }
            ]
          },
          "questionnaire" : "http://example.org/cdex-questionnaire-example1"
        },
        {
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
                "code": "payer-url"
              }
            ]
          },
          "valueUrl": "http://example.org/cdex/payer/$submit-attachment"
        },
        {
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
                "code": "purpose-of-use"
              }
            ]
          },
          "valueCodeableConcept": {
            "coding": [
              {
                "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                "code": "COVAUTH",
                "display": "coverage authorization"
              }
            ]
          }
        }
      ],
      "output": [
        {
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/temp",
                "code": "questionnaire-response"
              }
            ]
          },
          "valueReference": {
            "reference": "QuestionnaireResponse/cdex-questionnaireresponse-example1"
          }
        }
      ]
    }

Response Headers

    HTTP/1.1 200 OK

    Server: CDEX Example Provider Server

    Location: http://example.org/FHIR/Task/cdex-task-example22/_history/2

    ...(other headers)

#### Step 8 - EHR Updates Task Status To "completed" When Questionnaire Response Status Is "completed" (Not Shown).

#### Step 9 - EHR POSTs `$submit-attachment` Operation to Payer endpoint

Request

    POST [base]/$submit-attachment

Request Headers

Request Headers

    Accept: application/fhir+json
    Content-Type: application/fhir+json
    ...(other headers)

Request Body

    {
      "resourceType" : "Parameters",
      "parameter" : [{
        "name" : "TrackingId",
        "valueIdentifier" : {
          "system" : "http://example.org/payer-acns",
          "value" : "trackingid1012"
        }
      },
      {
        "name" : "AdminRefNumber",
        "valueIdentifier" : {
          "system" : "http://example.org/payer-refnos",
          "value" : "adminrefnumber4657"
        }
      },
      {
        "name" : "AttachTo",
        "valueCode" : "preauthorization"
      },
      {
        "name" : "PayerId",
        "valueIdentifier" : {
          "system" : "http://example.org/cdex/payer/payer-ids",
          "value" : "payer123"
        }
      },
      {
        "name" : "OrganizationId",
        "valueIdentifier" : {
          "system" : "http://hl7.org/fhir/sid/us-npi",
          "value" : "1234567893"
        }
      },
      {
        "name" : "ProviderId",
        "valueIdentifier" : {
          "system" : "http://hl7.org/fhir/sid/us-npi",
          "value" : "9941339100"
        }
      },
      {
        "name" : "MemberId",
        "valueIdentifier" : {
          "system" : "http://example.org/cdex/payer/member-ids",
          "value" : "Member123"
        }
      },
      {
        "name" : "Attachment",
        "part" : [{
          "name" : "LineItem",
          "valueString" : "1"
        },
        {
          "name" : "Content",
          "resource" : {
            "resourceType" : "QuestionnaireResponse",
            "id" : "cdex-questionnaireresponse-example1",
            "questionnaire" : "http://example.org/cdex-questionnaire-example1",
            "status" : "completed",
            "subject" : {
              "identifier" : {
                "use" : "usual",
                "type" : {
                  "coding" : [{
                    "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
                    "code" : "MB",
                    "display" : "Member Number"
                  }],
                  "text" : "Member Number"
                },
                "system" : "http://example.org/cdex/payer/member-ids",
                "value" : "Member123"
              },
              "display" : "Amy Shaw"
            },
            "authored" : "2022-06-17",
            "author" : {
              "identifier" : {
                "system" : "http://hl7.org/fhir/sid/us-npi",
                "value" : "9941339100"
              }
            },
            "item" : [{
              "linkId" : "1",
              "text" : "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)",
              "answer" : [{
                "valueString" : "Examplitis"
              }]
            },
            {
              "linkId" : "2",
              "text" : "Order Reason",
              "answer" : [{
                "valueCoding" : {
                  "system" : "http://example.org",
                  "code" : "4",
                  "display" : "Replacement"
                }
              }]
            }]
          }
        }]
      }]
    }

Response Headers

    HTTP/1.1 200 OK

    Server: CDEX Example Payer Server

    Content-Type: application/fhir+json;charset=utf-8

    ...(other headers)

#### Rendered QuestionnaireResponse

### Signatures

Refer to the Signatures section on the Sending Attachments page.