# PAS Workflow Overview: "Pended Response" If Additional information is Needed
## Next Steps for CDex RI
### 1. Submit PAS Request Bundle to PAS RI using the $submit Operation
1. [PAS RI endpoint instructions](https://github.com/HL7-DaVinci/prior-auth/wiki/Connectathon-README#authorization)
- [PAS RI FHIR Services](https://github.com/HL7-DaVinci/prior-auth#fhir-services):
2. Example PAS Claim Request Bundle to use to test (click on the "Details" link below to see Gist)
Contents:
1. Claim
1. Organization
1. Organization
1. Coverage
1. Patient
1. ServiceRequest
1. PractitionerRole
1. Practitioner
1. Location
In this PAS Claim Request Bundle the CPT Code '73722' that triggers the pended response Bundle
:::spoiler
{%gist Healthedata1/5482c8d672d416106822721e971cb347 %}
:::
3. Example of PAS Claim Responce Bundle expected to be returned by the PAS Server
The PAS CommunicationRequest has the LOINC Attachment Code 18748-4 “Diagnostic imaging study”.
Contents:
1. ClaimResponse
1. CommunicationRequest
1. Organization (insurer)
1. Organization (requester)
1. Patient
:::spoiler
{%gist Healthedata1/573447fbdd8398edbf5ebfb561691d1b %}
:::
3. See this [Postman Collection step](https://documenter.getpostman.com/view/1447203/U16jLkJL#0c4ec393-0d50-492e-be06-c94d98bdbe72) for example transaction to the PAS Server. Note that the PAS Server does not respond with the Correct PAS Response Bundle yet.
### 2. Map the PAS Response Bundle to a CDex Task Attachment Request Profile Instance Using the following mapping as a guide.
<!-- PAS_Bundle_to_task.md
*****************************************************************************************************
* WARNING: DO NOT EDIT THIS FILE *
* *
* This file is generated by csv_to_markdown_tabler.ipynb. Any edits you make to this file will be *
* overwritten *
* To change the contents of this file, edit input/images/data-element-mapping.csv *
*****************************************************************************************************
-->
| Data Element | CDex Request Attachment Task Profile Element | ClaimResponse (from PAS Response Bundle) | PAS Response Bundle |
|---|-----|------------|------------|
| Tracking ID | Task.identifier | ClaimResponse.identifier, ClaimResponse.item.commmunicationRequest: CommunicationRequest.identifier | ClaimResponse = Bundle.entry[0].resource, CommunicationRequest = Bundle.entry[n].resource referenced by ClaimResponse.communincationRequest |
| Use | Task.reasonCode | preauthorization | Fixed to "preauthorization" |
| Payer ID | Task.requester.identifier | ClaimResponse.insurer: Organization.identifier | ClaimResponse = Bundle.entry[0].resource, Organization = Bundle.entry[n].resource referenced by ClaimResponse.insurer |
| Payer URL | "payer-url" Task.input | out of band | out of band |
| Organization ID | PractitionerRole.practitioner.identifier | ClaimResponse.requester: Organization.identifier, ClaimResponse.requester: PractitionerRole.organization: Organziation.identifier | ClaimResponse = Bundle.entry[0].resource, Organization,PractitionerRole = Bundle.entry[n].resource referenced by ClaimResponse.requester |
| Provider ID | PractitionerRole.organization.identifier | ClaimResponse.requester: PractitionerRole.practitioner: Practitioner.identifier | ClaimResponse = Bundle.entry[0].resource, PractitionerRole = Bundle.entry[n].resource referenced by ClaimResponse.requester |
| Line Item(s) | “code” Task.input.extension | ClaimResponse.item.extension:itemTraceNumber Note: CommunicationRequest.payload.extension:serviceLineNumber references this item | ClaimResponse = Bundle.entry[0].resource |
| LOINC Attachment Code | “code” Task.input | ClaimResponse.item.commmunicationRequest: CommunicationRequest.payload.extension:contentModifier | ClaimResponse = Bundle.entry[0].resource |
| Date of Service | “service-date” Task.input | ClaimResponse.item.extension:requestedServiceDate | ClaimResponse = Bundle.entry[0].resource |
| Member ID | Patient.identifier | ClaimResponse.patient: Patient.identifer | ClaimResponse = Bundle.entry[0].resource, Patient = Bundle.entry[n].resource referenced by ClaimResponse.patient |
{:.grid}
The data element mapping table is available as a [CSV](https://build.fhir.org/ig/HL7/davinci-ecdx/data-element-mapping.csv) or [Excel](https://build.fhir.org/ig/HL7/davinci-ecdx/data-element-mapping.xlsx) file.
1. See this [Postman Collection's](https://documenter.getpostman.com/view/1447203/U16jLkJL#07a6dc09-f1be-40fc-a066-d5564fde1e05) *Pre-request Script* for an example mapping from the PAS Response Bundle to the CDex Parameters Submit Attachment Profile.
### 3. Instead of end user using the UI to create Task to request attachments , use the Task created in Step 2 to request attachments in the existing workflow.

### 4. (LAST STEP) $submit Solicited Attachment based on Task in Steps 2,3 to the *CDEX Payer Server*.
---
## Overview and Background
:exclamation: Limited to Loinc Attachment Codes
### From the PAS IG
- "The payer system is expected to immediately generate an automated response. Ideally, this will represent a final decision on the prior authorization request. However, in some cases, it may be necessary to submit textual documentation that will require semi-automated or manual review by the payer. In these situations, the prior authorization response will have a status of ‘pended’ and will be pended by the payer."
- "If additional information is needed, the provider can respond with the information via ... a CDex Submit-Attachment operation based on the X12 278 request for additional information"
- **:exclamation: Not covered here** a CDex Submit-Attachment operation where the LOINC code indicates a specific Questionnaire exists on the Payers Operation endpoint using the tracking ID as the business identifier
- **:exclamation: Covered** Information that is traditionally not structured, or where the review process is more involved and will not be performed in real time. In this use case, additional information may be in the form of progress notes, therapy notes, diagnostic reports, etc. This information will be exchanged as text or images using the document reference. Where such information is necessary, the initial request will typically be ‘pended’, with a final decision returned later once manual review is complete....
### Simplified Sequence Diagram Highlighting the "Pended" Response and Request for More Information
See the [background section](#Background) below for a more detailed interaction diagram
#### Assumptions and Preconditions
##### Assumptions
1. Assume CDex integrated within EHR
1. Assume all FHIR transactions (omitting the FHIR <-> X12 translations)
2. Trigger PAS RI with. MRI code CPT in Claim - Need to Create a new Claim resource to send (PAS to request imaging study LOINC)
3. Unclear if we need Patient or Provider context?
##### Preconditions:
When the PAS RI receives the `Claim.item.productOrService.coding.code` = 73722 (system='http://www.ama-assn.org/go/cpt', display “Magnetic resonance (eg, proton) imaging, any joint of lower extremity”), the value in this `CommunicationRequest.payload.extension:contentModifier` extension will be http://lonc.org|18748-4 “Diagnostic imaging study”
(We will make other productOrRequest codes with associated contentModifier values (such as the Questionnaire one) available in future versions)
```sequence
Note over EHR: Submit Prior Auth Request
EHR->Payer: $submit (PAS Request Bundle)
Payer -> Payer: Process PA Request
Note over Payer: Needs more information!
Payer --> EHR: PAS Pended Response Bundle\n
EHR->EHR: Process Request for more information
Note over EHR: Submit requested documents
EHR->Payer: $submit-attachment
Payer -> Payer: Process PA Request
Note over Payer: Approved!
Payer -> EHR: PAS Completed Response Bundle\n(poll or subscription)
```
### Functional Requirement and Roles for PAS and CDex Servers

### Mapping from the "PAS Bundle" to`$submit-attachment` Parameters
This interaction between the Payer and EHR requesting more information is a *solicited attachment transaction*. However, in contrast to the CDex Documentation, there is no CDex Task request but rather a Payer generated "PAS Response Bundle" containing a ClaimResponse and the associated resources it references. It includes the Tracking Id, LOINC attachment codes and other data elements needed to respond to the request using the $submit-attachement transaction. These data elements are mapped below.
<style>.markdown-body { max-width: 1500px; }</style>
<!-- attachments_to_PAS_Bundle.md
*****************************************************************************************************
* WARNING: DO NOT EDIT THIS FILE *
* *
* This file is generated by csv_to_markdown_tabler.ipynb. Any edits you make to this file will be *
* overwritten *
* To change the contents of this file, edit input/images/data-element-mapping.csv *
*****************************************************************************************************
-->
| Data Element | ClaimResponse (from PAS Response Bundle) | PAS Response Bundle |
|---|------------|------------|
| Tracking ID | ClaimResponse.identifier, ClaimResponse.item.commmunicationRequest: CommunicationRequest.identifier | ClaimResponse = Bundle.entry[0].resource, CommunicationRequest = Bundle.entry[n].resource referenced by ClaimResponse.communincationRequest |
| Use | preauthorization | Fixed to "preauthorization" |
| Payer ID | ClaimResponse.insurer: Organization.identifier | ClaimResponse = Bundle.entry[0].resource, Organization = Bundle.entry[n].resource referenced by ClaimResponse.insurer |
| Payer URL | out of band | out of band |
| Organization ID | ClaimResponse.requester: Organization.identifier, ClaimResponse.requester: PractitionerRole.organization: Organziation.identifier | ClaimResponse = Bundle.entry[0].resource, Organization,PractitionerRole = Bundle.entry[n].resource referenced by ClaimResponse.requester |
| Provider ID | ClaimResponse.requester: PractitionerRole.practitioner: Practitioner.identifier | ClaimResponse = Bundle.entry[0].resource, PractitionerRole = Bundle.entry[n].resource referenced by ClaimResponse.requester |
| Line Item(s) | ClaimResponse.item.extension:itemTraceNumber Note: CommunicationRequest.payload.extension:serviceLineNumber references this item | ClaimResponse = Bundle.entry[0].resource |
| LOINC Attachment Code | ClaimResponse.item.commmunicationRequest: CommunicationRequest.payload.extension:contentModifier | ClaimResponse = Bundle.entry[0].resource |
| Date of Service | ClaimResponse.item.extension:requestedServiceDate | ClaimResponse = Bundle.entry[0].resource |
| Member ID | ClaimResponse.patient: Patient.identifer | ClaimResponse = Bundle.entry[0].resource, Patient = Bundle.entry[n].resource referenced by ClaimResponse.patient |
{:.grid}
The data element mapping table is available as a [CSV](https://build.fhir.org/ig/HL7/davinci-ecdx/data-element-mapping.csv) or [Excel](https://build.fhir.org/ig/HL7/davinci-ecdx/data-element-mapping.xlsx) file.
### Mapping between "PAS Bundle" and X12 278 data elements
<!-- PAS_Bundle_to_278.md
*****************************************************************************************************
* WARNING: DO NOT EDIT THIS FILE *
* *
* This file is generated by csv_to_markdown_tabler.ipynb. Any edits you make to this file will be *
* overwritten *
* To change the contents of this file, edit input/images/data-element-mapping.csv *
*****************************************************************************************************
-->
| Data Element | X12n 278 Response-v5010 | ClaimResponse (from PAS Response Bundle) | PAS Response Bundle |
|---|---------|------------|------------|
| Tracking ID | Loop: 2000E Segment: TRN02 Notes: TRN01 = "1", patient event tracking number | ClaimResponse.identifier, ClaimResponse.item.commmunicationRequest: CommunicationRequest.identifier | ClaimResponse = Bundle.entry[0].resource, CommunicationRequest = Bundle.entry[n].resource referenced by ClaimResponse.communincationRequest |
| Use | Prior Auth | preauthorization | Fixed to "preauthorization" |
| Payer ID | Loop: 2010A Segment: NM109 Notes: NM108 = "PI" | ClaimResponse.insurer: Organization.identifier | ClaimResponse = Bundle.entry[0].resource, Organization = Bundle.entry[n].resource referenced by ClaimResponse.insurer |
| Payer URL | Loop: 2010A Segment: PER08 Notes: PER07 = "UR" | out of band | out of band |
| Organization ID | Loop: 2010B Segment: NM109 Notes: NM101 = id code qualifier, NM102 = "2" | ClaimResponse.requester: Organization.identifier, ClaimResponse.requester: PractitionerRole.organization: Organziation.identifier | ClaimResponse = Bundle.entry[0].resource, Organization,PractitionerRole = Bundle.entry[n].resource referenced by ClaimResponse.requester |
| Provider ID | Loop: 2010EA Segment: NM109 Notes: NM101 = id code qualifier , NM102 = "1" | ClaimResponse.requester: PractitionerRole.practitioner: Practitioner.identifier | ClaimResponse = Bundle.entry[0].resource, PractitionerRole = Bundle.entry[n].resource referenced by ClaimResponse.requester |
| Line Item(s) | Loop: 2000F Segment: TRN02 Notes: TRN01 = "1" | ClaimResponse.item.extension:itemTraceNumber Note: CommunicationRequest.payload.extension:serviceLineNumber references this item | ClaimResponse = Bundle.entry[0].resource |
| LOINC Attachment Code | Loop: 2000E Segment: HI?? or Loop: 2000F Segment: PWK?? Notes: Clarify! | ClaimResponse.item.commmunicationRequest: CommunicationRequest.payload.extension:contentModifier | ClaimResponse = Bundle.entry[0].resource |
| Date of Service | Loop: 2000E (event level) or 2000F (line level) Segment: DTP03 Notes: DTP01="742" DTP02 = date format code | ClaimResponse.item.extension:requestedServiceDate | ClaimResponse = Bundle.entry[0].resource |
| Member ID | Loop: 2010C Segment: NM109 Notes: NM108 = id code qualifier | ClaimResponse.patient: Patient.identifer | ClaimResponse = Bundle.entry[0].resource, Patient = Bundle.entry[n].resource referenced by ClaimResponse.patient |
{:.grid}
The data element mapping table is available as a [CSV](https://build.fhir.org/ig/HL7/davinci-ecdx/data-element-mapping.csv) or [Excel](https://build.fhir.org/ig/HL7/davinci-ecdx/data-element-mapping.xlsx) file.
### Examples
#### PAS Resource Examples
<!--
##### FHIR ClaimResponse Resource for Approved Claim
:::spoiler
{%gist FHIR https://gist.github.com/Healthedata1/6f58c842f088828310531f633f8d0c91 %}
:::
##### FHIR ClaimResponse Resource for Pended Claim for More Information
:::spoiler
{%gist Healthedata1/60fe37274344102a014572274cee3be2 %}
:::
-->
##### FHIR CommunicationRequest Resource for Requesting Attachments
:::spoiler
{%gist Healthedata1/b421aaab4175fe9b6e8c5af24ca7838c %}
:::
##### Pended PAS Response Bundle Requesting More Information
The PAS CommunicationRequest has the LOINC Attachment Code 18748-4 “Diagnostic imaging study”.
Contents:
1. ClaimResponse
1. CommunicationRequest
1. Organization (insurer)
1. Organization (requester)
1. Patient
:::spoiler
{%gist Healthedata1/573447fbdd8398edbf5ebfb561691d1b %}
:::
##### Completed PAS Response Bundle
Cmpleted adjudicated response that approves the prior-authorization
Contents:
1. ClaimResponse
1. Organization (insurer)
1. Organization (requester)
1. Patient
:::spoiler
## :construction_worker: TODO
:::
#### `$submit-attachment` Operation
:::spoiler
## :construction_worker: TODO
:::
<!-- ## Can the CDEX Reference Implementation Provider Server (RI) Simulate the EHR Role for this Transaction?
### Questions?
What would the functional role of the CDEX RI be?
1. Would the CDEX RI be submitting the initial claims to Payer system using `$submit` operation and the PAS Bundle Payload?
1. Capabilities of the PAS RI(https://github.com/HL7-DaVinci/prior-auth)?
1. Payer serve as the both Payer + intermediary
1. support subscriptions for pended results
1. PAS operations ($submit)
1. Contact for demonstration
1. Would the CDEX RI subscribe to get updates for pended results? Yes -->
## Background
### Detailed PAS CDex Interaction

### Annotated [PAS CommunicationRequest](http://build.fhir.org/ig/HL7/davinci-pas/StructureDefinition-profile-communicationrequest.html)

### Annotated [CDex $submit_attachment](http://hl7.org/fhir/us/davinci-cdex/OperationDefinition-submit-attachment.html)
Showing the relationship to the patient event Tracking Number and service level tracking number

### Annotated [CDex Task Attachment Request Profile](http://hl7.org/fhir/us/davinci-cdex/StructureDefinition-cdex-task-attachment-request.html)
Showing the relationship to the patient event Tracking Number and service level tracking number
