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

Publication Build: This will be filled in by the publication tooling

## 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
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
Date of Service | ServiceDate | “service-date” Task.input
Member ID | MemberId | Patient.identifier
Questionnaire | - | “QuestionnaireContext” 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 the Tracking ID

The mandatory `Task.identifier` tracking-id slice element represents the Payer tracking identifier. The tracking-id (the "re-association tracking control number") is an identifier that ties the attachments back to the claim or prior authorization. The Provider will echo it 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    }],

##### 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".

    65    "status" : "requested",
    66    "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.

    67    "code" : {
    68      "coding" : [{
    69        "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    70        "code" : "attachment-request-questionnaire"
    71      }],
    72      "text" : "Attachment Request Questionnaire"
    73    },

##### 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

    74    "for" : {
    75      "reference" : "#patient"
    76    },
    77    "authoredOn" : "2022-06-17T16:16:06Z",
    78    "lastModified" : "2022-06-17T16:16:06Z",
    79    "requester" : {
    80      "identifier" : {
    81        "system" : "http://example.org/cdex/payer/payer-ids",
    82        "value" : "Payer123"
    83      }
    84    },
    85    "owner" : {
    86      "reference" : "#practitionerrole"
    87    },

##### 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`

    88    "reasonCode" : {
    89      "coding" : [{
    90        "system" : "http://hl7.org/fhir/claim-use",
    91        "code" : "preauthorization",
    92        "display" : "Preauthorization"
    93      }],
    94      "text" : "preauthorization"
    95    },
    96    "reasonReference" : {
    97      "identifier" : {
    98        "system" : "http://example.org/cdex/payer/claim-ids",
    99        "value" : "Preauth123"
    100      }
    101    },
    102    "restriction" : {
    103      "period" : {

##### 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.

    102    "restriction" : {
    103      "period" : {
    104        "end" : "2022-06-21"
    105      }
    106    },

##### 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.

    107    "input" : [{
    108      "extension" : [{
    109        "url" : "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-paLineNumber",
    110        "valueInteger" : 1
    111      }],
    112      "type" : {
    113        "coding" : [{
    114          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    115          "code" : "questionnaire-context"
    116        }]
    117      },
    118      "valueCanonical" : "http://example.org/cdex-questionnaire-example1"
    119    },

##### 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.

    120    {
    121      "type" : {
    122        "coding" : [{
    123          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    124          "code" : "payer-url"
    125        }]
    126      },
    127      "valueUrl" : "http://example.org/cdex/payer/$submit-attachment"
    128    },
    129    {
    130      "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".

    129    {
    130      "type" : {
    131        "coding" : [{
    132          "system" : "http://hl7.org/fhir/us/davinci-cdex/CodeSystem/cdex-temp",
    133          "code" : "purpose-of-use"
    134        }]
    135      },
    136      "valueCodeableConcept" : {
    137        "coding" : [{
    138          "system" : "http://terminology.hl7.org/CodeSystem/v3-ActReason",
    139          "code" : "COVAUTH",
    140          "display" : "coverage authorization"
    141        }]
    142      }
    143    }]
    144  }

#### 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",
    ...
    112      "type" : {
    113        "coding" : [{
    114          "system" : "http://hl7.org/fhir/us/davinci-pas/CodeSystem/PASTempCodes",
    115          "code" : "questionnaire-context"
    116        }]
    117      },
    118      "valueCanonical" : "http://example.org/cdex-questionnaire-example1"
    119    },
    ....

##### 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><a name=\"cdex-questionnaire-example1-en-US\"> </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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"The linkID for the item\">LinkID</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"Text for the item\">Text</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"The type of the item\">Type</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"Additional information about the item\">Description &amp; Constraints</a><span style=\"float: right\"><a href=\"http://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 : 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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Questionnaire</td><td style=\"vertical-align: top; text-align : 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 : 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 : 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 : 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 : left; background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/codesystem-item-type.html#item-type-text\">text</a></td><td style=\"vertical-align: top; text-align : 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 : 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 : 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 : 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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/codesystem-item-type.html#item-type-choice\">choice</a></td><td style=\"vertical-align: top; text-align : 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=\"http://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",
    ...
    202    "output": [
    203      {
    204        "type": {
    205          "coding": [
    206            {
    207              "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/temp",
    208              "code": "questionnaire-response"
    209            }
    210          ]
    211        },
    212        "valueReference": {
    213          "reference": "QuestionnaireResponse/cdex-questionnaireresponse-example1"
    214        }
    215      }
    216    ]

#### 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" : [{

##### Tracking ID and Indicating a Claim or Prior Authorization

The TrackingId parameter represents the identifier that ties the attachments to the claim or prior authorization. It is often referred to as the "re-association tracking control number". The operation must 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
Use | Task.reasonCode | AttachTo

    3      "name" : "TrackingId",
    4      "valueIdentifier" : {
    5        "system" : "http://example.org/payer",
    6        "value" : "trackingid1012"
    7      }
    8    },
    9    {
    10      "name" : "AttachTo",
    11      "valueCode" : "preauthorization"
    12    },
    13    {

##### 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

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

##### 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

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

### 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"
      }],
      "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><a name=\"cdex-task-example22-en-US\"> </a><p><b>identifier</b>: Re-Association Tracking Control Number/trackingid1012</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><a name=\"cdex-task-example22/patient-en-US\"> </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><a name=\"cdex-task-example22/practitionerrole-en-US\"> </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"
      }],
      "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><a name=\"cdex-questionnaire-example1-en-US\"> </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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"The linkID for the item\">LinkID</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"Text for the item\">Text</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"The type of the item\">Type</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"Additional information about the item\">Description &amp; Constraints</a><span style=\"float: right\"><a href=\"http://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 : 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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Questionnaire</td><td style=\"vertical-align: top; text-align : 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 : 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 : 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 : 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 : left; background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/codesystem-item-type.html#item-type-text\">text</a></td><td style=\"vertical-align: top; text-align : 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 : 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 : 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 : 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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/codesystem-item-type.html#item-type-choice\">choice</a></td><td style=\"vertical-align: top; text-align : 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=\"http://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><a name=\"cdex-questionnaireresponse-example1-en-US\"> </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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"The linkID for the item\">LinkID</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"Text for the item\">Text</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><a href=\"http://hl7.org/fhir/R4/formats.html#table\" title=\"The type of the item\">Answer</a><span style=\"float: right\"><a href=\"http://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 : 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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : 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 : 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 : 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 : left; background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : 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 : 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 : 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 : left; background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : 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=\"http://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"
        }
      ],
      "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",
          "value" : "trackingid1012"
        }
      },
      {
        "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.